Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

Consistent cli #14

Closed
wants to merge 8 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,9 @@ struct Args {
}

#[derive(StructOpt, Debug)]
#[structopt(bin_name = "cargo")]
#[structopt(name = "cargo", raw(setting = "AppSettings::ColoredHelp"))]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prior to this change (there is no color):

$ ./target/debug/cargo-ebuild ebuild --help
cargo-ebuild 0.1.6-pre
Doug Goldstein <cardoe@cardoe.com>
Generates an ebuild for a given Cargo project

USAGE:
    cargo ebuild [OPTIONS]

OPTIONS:
    -q, --quiet      Silence all output
    -v, --verbose    Verbose mode (-v, -vv, -vvv, etc.)
    -h, --help       Prints help information
    -V, --version    Prints version information

With this change (there is still no color):

$ ./target/debug/cargo-ebuild ebuild --help
cargo-ebuild-ebuild 0.1.6-pre
Doug Goldstein <cardoe@cardoe.com>
Generates an ebuild for a given Cargo project

USAGE:
    cargo-ebuild ebuild [OPTIONS]

OPTIONS:
    -q, --quiet      Silence all output
    -v, --verbose    Verbose mode (-v, -vv, -vvv, etc.)
    -h, --help       Prints help information
    -V, --version    Prints version information

So not only does this not add color but it breaks the help output. I would drop this patch.

enum Opt {
#[structopt(
name = "ebuild",
raw(
setting = "AppSettings::UnifiedHelpMessage",
setting = "AppSettings::DeriveDisplayOrder",
setting = "AppSettings::DontCollapseArgsInUsage"
)
)]
#[structopt( name = "ebuild",)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing comma

/// Generates an ebuild for a given Cargo project
Ebuild(Args),
}
Expand Down