all utils: remove short help flag if another -h flag is present

This commit is contained in:
Terts Diepraam 2022-03-20 10:14:32 +01:00
parent 32cadbc715
commit d90a81fb46
11 changed files with 59 additions and 0 deletions

View file

@ -29,6 +29,7 @@ const USAGE: &str = "\
{} [OPTION]... --reference=RFILE FILE...";
pub mod options {
pub static HELP: &str = "help";
pub static VERBOSE: &str = "verbose";
pub static REFERENCE: &str = "reference";
@ -160,6 +161,11 @@ pub fn uu_app<'a>() -> Command<'a> {
.about(ABOUT)
.override_usage(format_usage(USAGE))
.infer_long_args(true)
.arg(
Arg::new(options::HELP)
.long(options::HELP)
.help("Print help information."),
)
.arg(
Arg::new(options::dereference::DEREFERENCE)
.long(options::dereference::DEREFERENCE)

View file

@ -60,6 +60,11 @@ pub fn uu_app<'a>() -> Command<'a> {
.about(ABOUT)
.override_usage(format_usage(USAGE))
.infer_long_args(true)
.arg(
Arg::new(options::HELP)
.long(options::HELP)
.help("Print help information.")
)
.arg(
Arg::new(options::verbosity::CHANGES)
.short('c')

View file

@ -69,6 +69,11 @@ pub fn uu_app<'a>() -> Command<'a> {
.about(ABOUT)
.override_usage(format_usage(USAGE))
.infer_long_args(true)
.arg(
Arg::new(options::HELP)
.long(options::HELP)
.help("Print help information."),
)
.arg(
Arg::new(options::verbosity::CHANGES)
.short('c')

View file

@ -29,6 +29,7 @@ static ABOUT: &str = "Show information about the file system on which each FILE
or all file systems by default.";
const USAGE: &str = "{} [OPTION]... [FILE]...";
static OPT_HELP: &str = "help";
static OPT_ALL: &str = "all";
static OPT_BLOCKSIZE: &str = "blocksize";
static OPT_DIRECT: &str = "direct";
@ -322,6 +323,11 @@ pub fn uu_app<'a>() -> Command<'a> {
.about(ABOUT)
.override_usage(format_usage(USAGE))
.infer_long_args(true)
.arg(
Arg::new(OPT_HELP)
.long(OPT_HELP)
.help("Print help information."),
)
.arg(
Arg::new(OPT_ALL)
.short('a')

View file

@ -47,6 +47,7 @@ use winapi::um::winbase::GetFileInformationByHandleEx;
use winapi::um::winnt::{FILE_ID_128, ULONGLONG};
mod options {
pub const HELP: &str = "help";
pub const NULL: &str = "0";
pub const ALL: &str = "all";
pub const APPARENT_SIZE: &str = "apparent-size";
@ -624,6 +625,11 @@ pub fn uu_app<'a>() -> Command<'a> {
.after_help(LONG_HELP)
.override_usage(format_usage(USAGE))
.infer_long_args(true)
.arg(
Arg::new(options::HELP)
.long(options::HELP)
.help("Print help information.")
)
.arg(
Arg::new(options::ALL)
.short('a')

View file

@ -116,6 +116,7 @@ pub mod options {
pub static DIR_ARGS: &str = "dereference-command-line-symlink-to-dir";
}
pub static HELP: &str = "help";
pub static QUOTING_STYLE: &str = "quoting-style";
pub static HIDE_CONTROL_CHARS: &str = "hide-control-chars";
pub static SHOW_CONTROL_CHARS: &str = "show-control-chars";
@ -806,6 +807,11 @@ pub fn uu_app<'a>() -> Command<'a> {
whose names start with '.'.",
)
.infer_long_args(true)
.arg(
Arg::new(options::HELP)
.long(options::HELP)
.help("Print help information.")
)
// Format arguments
.arg(
Arg::new(options::FORMAT)

View file

@ -66,6 +66,7 @@ enum NumberFormat {
}
pub mod options {
pub const HELP: &str = "help";
pub const FILE: &str = "file";
pub const BODY_NUMBERING: &str = "body-numbering";
pub const SECTION_DELIMITER: &str = "section-delimiter";
@ -145,6 +146,11 @@ pub fn uu_app<'a>() -> Command<'a> {
.version(crate_version!())
.override_usage(format_usage(USAGE))
.infer_long_args(true)
.arg(
Arg::new(options::HELP)
.long(options::HELP)
.help("Print help information."),
)
.arg(
Arg::new(options::FILE)
.hide(true)

View file

@ -98,6 +98,7 @@ If an error occurred, a diagnostic message will be printed to stderr, and the
exitcode will be non-zero."#;
pub(crate) mod options {
pub const HELP: &str = "help";
pub const ADDRESS_RADIX: &str = "address-radix";
pub const SKIP_BYTES: &str = "skip-bytes";
pub const READ_BYTES: &str = "read-bytes";
@ -299,6 +300,11 @@ pub fn uu_app<'a>() -> Command<'a> {
.dont_delimit_trailing_values(true)
.infer_long_args(true)
.setting(AppSettings::DeriveDisplayOrder)
.arg(
Arg::new(options::HELP)
.long(options::HELP)
.help("Print help information.")
)
.arg(
Arg::new(options::ADDRESS_RADIX)
.short('A')

View file

@ -98,6 +98,7 @@ mod options {
pub const DIAGNOSE_FIRST: &str = "diagnose-first";
}
pub const HELP: &str = "help";
pub const DICTIONARY_ORDER: &str = "dictionary-order";
pub const MERGE: &str = "merge";
pub const DEBUG: &str = "debug";
@ -1274,6 +1275,11 @@ pub fn uu_app<'a>() -> Command<'a> {
.about(ABOUT)
.override_usage(format_usage(USAGE))
.infer_long_args(true)
.arg(
Arg::new(options::HELP)
.long(options::HELP)
.help("Print help information."),
)
.arg(
Arg::new(options::modes::SORT)
.long(options::modes::SORT)

View file

@ -31,6 +31,7 @@ pub mod options {
pub static REFERENCE: &str = "reference";
pub static CURRENT: &str = "current";
}
pub static HELP: &str = "help";
pub static ACCESS: &str = "access";
pub static MODIFICATION: &str = "modification";
pub static NO_CREATE: &str = "no-create";
@ -155,6 +156,11 @@ pub fn uu_app<'a>() -> Command<'a> {
.about(ABOUT)
.override_usage(format_usage(USAGE))
.infer_long_args(true)
.arg(
Arg::new(options::HELP)
.long(options::HELP)
.help("Print help information."),
)
.arg(
Arg::new(options::ACCESS)
.short('a')

View file

@ -383,6 +383,7 @@ impl ChownExecutor {
}
pub mod options {
pub const HELP: &str = "help";
pub mod verbosity {
pub const CHANGES: &str = "changes";
pub const QUIET: &str = "quiet";