Skip to content

ls: make --block-size and --human-readable/--si override each other#5641

Merged
tertsdiepraam merged 2 commits intouutils:mainfrom
cakebaker:ls_block_size_si_human_readable
Dec 14, 2023
Merged

ls: make --block-size and --human-readable/--si override each other#5641
tertsdiepraam merged 2 commits intouutils:mainfrom
cakebaker:ls_block_size_si_human_readable

Conversation

@cakebaker
Copy link
Copy Markdown
Contributor

This PR makes --block-size and --human-readable/--si override each other to match the behavior of GNU ls.

@tertsdiepraam
Copy link
Copy Markdown
Collaborator

Excellent! A related problem is:

> ls --human-readable --human-readable
error: the argument '--human-readable' cannot be used multiple times

Usage: target/debug/coreutils ls [OPTION]... [FILE]...

I think it should use https://docs.rs/clap/latest/clap/struct.Command.html#method.args_override_self

But feel free to merge without that.

@cakebaker
Copy link
Copy Markdown
Contributor Author

Good point, I enabled it in the latest push.

@tertsdiepraam tertsdiepraam linked an issue Dec 14, 2023 that may be closed by this pull request
@tertsdiepraam tertsdiepraam merged commit 66bd065 into uutils:main Dec 14, 2023
@cakebaker cakebaker deleted the ls_block_size_si_human_readable branch December 14, 2023 16:05
@tertsdiepraam
Copy link
Copy Markdown
Collaborator

Great! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ls: Don't reject multiple use of --color

2 participants