Repository: sharkdp/fd
File: src/app.rs (Rust)

Code before:
    let mut app = App::new("fd")
        .version(crate_version!())
        .usage("fd [FLAGS/OPTIONS] [<pattern>] [<path>...]")
        .setting(clap_color_setting)
        .setting(AppSettings::DeriveDisplayOrder)
        .after_help(
            "Note: `fd -h` prints a short and concise overview while `fd --help` gives all \
                 details.",
        )
        .arg(
            Arg::with_name("hidden")
                .long("hidden")
                .short("H")
                .overrides_with("hidden")
                .help("Search hidden files and directories")
                .long_help(
                    "Include hidden directories and files in the search results (default: \
                         hidden files and directories are skipped). Files and directories are \
                         considered to be hidden if their name starts with a `.` sign (dot). \
                         Flag can be overridden with --no-hidden.",
                ),
        )
        .arg(
            Arg::with_name("no-hidden")
                .long("no-hidden")
                .overrides_with("no-hidden")
                .hidden(true)
                .long_help(
                    "Overrides --hidden.",
                ),
        )
        .arg(
            Arg::with_name("no-ignore")
                .long("no-ignore")
                .short("I")
                .overrides_with("no-ignore")
                .help("Do not respect .(git|fd)ignore files")
                .long_help(
                    "Show search results from files and directories that would otherwise be \
                         ignored by '.gitignore', '.ignore', '.fdignore', or the global ignore file. \
                         Flag can be overridden with --ignore.",
                ),
        )
        .arg(
            Arg::with_name("ignore")
                .long("ignore")
                .overrides_with("ignore")
                .hidden(true)
                .long_help(
                    "Overrides --no-ignore.",
                ),

Review comment (refactor):
Shouldn't it also override `--hidden`? We don't want `--hidden` and `--no-hidden` to be present at the same time, right? This way, you might even be able to simplify the logic in `main.rs` (not completely sure).

Code after:
    let mut app = App::new("fd")
        .version(crate_version!())
        .usage("fd [FLAGS/OPTIONS] [<pattern>] [<path>...]")
        .setting(clap_color_setting)
        .setting(AppSettings::DeriveDisplayOrder)
        .after_help(
            "Note: `fd -h` prints a short and concise overview while `fd --help` gives all \
                 details.",
        )
        .arg(
            Arg::with_name("hidden")
                .long("hidden")
                .short("H")
                .overrides_with("hidden")
                .help("Search hidden files and directories")
                .long_help(
                    "Include hidden directories and files in the search results (default: \
                         hidden files and directories are skipped). Files and directories are \
                         considered to be hidden if their name starts with a `.` sign (dot). \
                         The flag can be overridden with --no-hidden.",
                ),
        )
        .arg(
            Arg::with_name("no-hidden")
                .long("no-hidden")
                .overrides_with("hidden")
                .hidden(true)
                .long_help(
                    "Overrides --hidden.",
                ),
        )
        .arg(
            Arg::with_name("no-ignore")
                .long("no-ignore")
                .short("I")
                .overrides_with("no-ignore")
                .help("Do not respect .(git|fd)ignore files")
                .long_help(
                    "Show search results from files and directories that would otherwise be \
                         ignored by '.gitignore', '.ignore', '.fdignore', or the global ignore file. \
                         The flag can be overridden with --ignore.",
                ),
        )
        .arg(
            Arg::with_name("ignore")
                .long("ignore")
                .overrides_with("no-ignore")
                .hidden(true)
                .long_help(
                    "Overrides --no-ignore.",
                ),