wc: accept shortcuts for stringly-enum arguments

This commit is contained in:
Ben Wiederhake 2024-04-01 08:06:18 +02:00
parent a699bfd1fb
commit 91679fc747
2 changed files with 26 additions and 1 deletions

View file

@ -29,6 +29,7 @@ use uucore::{
error::{FromIo, UError, UResult},
format_usage, help_about, help_usage,
quoting_style::{escape_name, QuotingStyle},
shortcut_value_parser::ShortcutValueParser,
show,
};
@ -439,7 +440,9 @@ pub fn uu_app() -> Command {
.arg(
Arg::new(options::TOTAL)
.long(options::TOTAL)
.value_parser(["auto", "always", "only", "never"])
.value_parser(ShortcutValueParser::new([
"auto", "always", "only", "never",
]))
.value_name("WHEN")
.hide_possible_values(true)
.help(concat!(