1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

sort: make -k only take one argument per flag

This makes it so that `sort -k 1 file` treats `file` as the input file
and not the second key.
This commit is contained in:
Michael Debertol 2021-07-06 13:26:28 +02:00
parent 54b389fd1a
commit 8ace291b32
2 changed files with 9 additions and 0 deletions

View file

@ -1267,6 +1267,7 @@ pub fn uu_app() -> App<'static, 'static> {
.help("sort by a key")
.long_help(LONG_HELP_KEYS)
.multiple(true)
.number_of_values(1)
.takes_value(true),
)
.arg(

View file

@ -951,3 +951,11 @@ fn test_conflict_check_out() {
);
}
}
#[test]
fn test_key_takes_one_arg() {
new_ucmd!()
.args(&["-k", "2.3", "keys_open_ended.txt"])
.succeeds()
.stdout_is_fixture("keys_open_ended.expected");
}