From 753595e549a6631fe303e7ba66d8f7911f01c7ec Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 23 Sep 2023 13:32:07 -0700 Subject: [PATCH] Reorder opts to match cargo --- src/opts.rs | 100 ++++++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/src/opts.rs b/src/opts.rs index 1360180..3566c7c 100644 --- a/src/opts.rs +++ b/src/opts.rs @@ -20,17 +20,37 @@ pub enum Subcommand { #[derive(Parser, Debug)] pub struct Expand { - /// Space-separated list of features to activate - #[arg(long, value_name = "FEATURES", help_heading = FEATURE_SELECTION)] - pub features: Option, + /// Do not attempt to run rustfmt + #[arg(long)] + pub ugly: bool, - /// Activate all available features - #[arg(long, help_heading = FEATURE_SELECTION)] - pub all_features: bool, + /// Select syntax highlighting theme + #[arg(long, value_name = "NAME")] + pub theme: Option, - /// Do not activate the `default` feature - #[arg(long, help_heading = FEATURE_SELECTION)] - pub no_default_features: bool, + /// Print available syntax highlighting theme names + #[arg(long)] + pub themes: bool, + + /// Print command lines as they are executed + #[arg(long)] + pub verbose: bool, + + /// Coloring: auto, always, never + #[arg(long, value_name = "WHEN")] + pub color: Option, + + /// Unstable (nightly-only) flags to Cargo + #[arg(short = 'Z', value_name = "FLAG")] + pub unstable_flags: Vec, + + /// Print version + #[arg(long)] + pub version: bool, + + /// Package to expand + #[arg(short, long, value_name = "SPEC", num_args = 0..=1, help_heading = PACKAGE_SELECTION)] + pub package: Option>, /// Expand only this package's library #[arg(long, help_heading = TARGET_SELECTION)] @@ -56,21 +76,21 @@ pub struct Expand { #[arg(long, value_name = "NAME", num_args = 0..=1, help_heading = TARGET_SELECTION)] pub bench: Option>, - /// Target triple which compiles will be for - #[arg(long, value_name = "TARGET", help_heading = COMPILATION_OPTIONS)] - pub target: Option, + /// Space-separated list of features to activate + #[arg(long, value_name = "FEATURES", help_heading = FEATURE_SELECTION)] + pub features: Option, - /// Directory for all generated artifacts - #[arg(long, value_name = "DIRECTORY", help_heading = COMPILATION_OPTIONS)] - pub target_dir: Option, + /// Activate all available features + #[arg(long, help_heading = FEATURE_SELECTION)] + pub all_features: bool, - /// Path to Cargo.toml - #[arg(long, value_name = "PATH", help_heading = MANIFEST_OPTIONS)] - pub manifest_path: Option, + /// Do not activate the `default` feature + #[arg(long, help_heading = FEATURE_SELECTION)] + pub no_default_features: bool, - /// Package to expand - #[arg(short, long, value_name = "SPEC", num_args = 0..=1, help_heading = PACKAGE_SELECTION)] - pub package: Option>, + /// Number of parallel jobs, defaults to # of CPUs + #[arg(short, long, value_name = "N", help_heading = COMPILATION_OPTIONS)] + pub jobs: Option, /// Build artifacts in release mode, with optimizations #[arg(long, help_heading = COMPILATION_OPTIONS)] @@ -80,17 +100,17 @@ pub struct Expand { #[arg(long, value_name = "PROFILE-NAME", help_heading = COMPILATION_OPTIONS)] pub profile: Option, - /// Number of parallel jobs, defaults to # of CPUs - #[arg(short, long, value_name = "N", help_heading = COMPILATION_OPTIONS)] - pub jobs: Option, + /// Target triple which compiles will be for + #[arg(long, value_name = "TARGET", help_heading = COMPILATION_OPTIONS)] + pub target: Option, - /// Print command lines as they are executed - #[arg(long)] - pub verbose: bool, + /// Directory for all generated artifacts + #[arg(long, value_name = "DIRECTORY", help_heading = COMPILATION_OPTIONS)] + pub target_dir: Option, - /// Coloring: auto, always, never - #[arg(long, value_name = "WHEN")] - pub color: Option, + /// Path to Cargo.toml + #[arg(long, value_name = "PATH", help_heading = MANIFEST_OPTIONS)] + pub manifest_path: Option, /// Require Cargo.lock and cache are up to date #[arg(long, help_heading = MANIFEST_OPTIONS)] @@ -104,29 +124,9 @@ pub struct Expand { #[arg(long, help_heading = MANIFEST_OPTIONS)] pub offline: bool, - /// Unstable (nightly-only) flags to Cargo - #[arg(short = 'Z', value_name = "FLAG")] - pub unstable_flags: Vec, - - /// Do not attempt to run rustfmt - #[arg(long)] - pub ugly: bool, - - /// Select syntax highlighting theme - #[arg(long, value_name = "NAME")] - pub theme: Option, - - /// Print available syntax highlighting theme names - #[arg(long)] - pub themes: bool, - /// Local path to module or other named item to expand, e.g. os::unix::ffi #[arg(value_name = "ITEM", value_parser = parse_selector)] pub item: Option, - - /// Print version - #[arg(long)] - pub version: bool, } #[derive(ValueEnum, Debug, Clone, Copy)]