1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

cut: add display order

This commit is contained in:
Yagiz Degirmenci 2021-04-03 20:30:28 +03:00
parent 7e677b3e6c
commit e84b60b7d5

View file

@ -430,7 +430,6 @@ mod options {
pub const CHARACTERS: &str = "characters";
pub const DELIMITER: &str = "delimiter";
pub const FIELDS: &str = "fields";
pub const LEGACY_OPTION: &str = "legacy-option";
pub const ZERO_TERMINATED: &str = "zero-terminated";
pub const ONLY_DELIMITED: &str = "only-delimited";
pub const OUTPUT_DELIMITER: &str = "output-delimiter";
@ -454,7 +453,8 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
.takes_value(true)
.help("filter byte columns from the input source")
.allow_hyphen_values(true)
.value_name("LIST"),
.value_name("LIST")
.display_order(1),
)
.arg(
Arg::with_name(options::CHARACTERS)
@ -463,7 +463,8 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
.help("alias for character mode")
.takes_value(true)
.allow_hyphen_values(true)
.value_name("LIST"),
.value_name("LIST")
.display_order(2),
)
.arg(
Arg::with_name(options::DELIMITER)
@ -471,7 +472,8 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
.long(options::DELIMITER)
.help("specify the delimiter character that separates fields in the input source. Defaults to Tab.")
.takes_value(true)
.value_name("DELIM"),
.value_name("DELIM")
.display_order(3),
)
.arg(
Arg::with_name(options::FIELDS)
@ -480,20 +482,15 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
.help("filter field columns from the input source")
.takes_value(true)
.allow_hyphen_values(true)
.value_name("LIST"),
)
.arg(
Arg::with_name(options::LEGACY_OPTION)
.short("n")
.long(options::LEGACY_OPTION)
.help("legacy option - has no effect.")
.takes_value(false)
.value_name("LIST")
.display_order(4),
)
.arg(
Arg::with_name(options::COMPLEMENT)
.long(options::COMPLEMENT)
.help("invert the filter - instead of displaying only the filtered columns, display all but those columns")
.takes_value(false)
.display_order(5),
)
.arg(
Arg::with_name(options::ONLY_DELIMITED)
@ -501,6 +498,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
.long(options::ONLY_DELIMITED)
.help("in field mode, only print lines which contain the delimiter")
.takes_value(false)
.display_order(6),
)
.arg(
Arg::with_name(options::ZERO_TERMINATED)
@ -508,6 +506,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
.long(options::ZERO_TERMINATED)
.help("instead of filtering columns based on line, filter columns based on \\0 (NULL character)")
.takes_value(false)
.display_order(8),
)
.arg(
Arg::with_name(options::OUTPUT_DELIMITER)
@ -515,6 +514,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
.help("in field mode, replace the delimiter in output lines with this option's argument")
.takes_value(true)
.value_name("NEW_DELIM")
.display_order(7),
)
.arg(
Arg::with_name(options::FILE)