Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow repeated flags much more often #5998

Open
BenWiederhake opened this issue Feb 23, 2024 · 8 comments · Fixed by #6006, #6007 or #6018
Open

Allow repeated flags much more often #5998

BenWiederhake opened this issue Feb 23, 2024 · 8 comments · Fixed by #6006, #6007 or #6018

Comments

@BenWiederhake
Copy link
Collaborator

BenWiederhake commented Feb 23, 2024

If seems that there are many cases where we define self-conflicts, but GNU accepts repeated arguments. This is especially unnecessary for boolean flags. Let's fix that! This issue tracks progress for all utils.

  • chgrp: at least -v is broken
  • chmod: not considered yet
  • chown: not considered yet
  • chroot: not considered yet
  • comm: at least -1 is broken
  • cp: at least -a is handled correctly
  • csplit: at least -k is broken
  • date: at least --resolution is broken: date: implement --resolution #6143 , rest is fixed by date: fix interaction of flags, fix issues around --set #6142
  • du: at least -s is broken
  • echo: at least -n is broken
  • fmt: at least -c is broken, fixed by fmt: accept repeated arguments #6355
  • fold: at least -b is broken
  • id: at least -u is broken
  • install: at least -b is broken
  • join: at least -z is broken
  • kill: at least -l is broken
  • ln: not considered yet
  • logname: not considered yet
  • ls: not considered yet
  • mkdir: not considered yet
  • mkfifo: not considered yet
  • mknod: not considered yet
  • mktemp: not considered yet
  • more: not considered yet
  • mv: not considered yet
  • nice: not considered yet
  • nl: not considered yet
  • nohup: not considered yet
  • nproc: not considered yet
  • numfmt: not considered yet
  • od: not considered yet
  • paste: not considered yet
  • pathchk: not considered yet
  • pinky: not considered yet
  • pr: not considered yet
  • printenv: not considered yet
  • printf: not considered yet
  • ptx: not considered yet
  • pwd: not considered yet
  • readlink: not considered yet
  • realpath: not considered yet
  • rm: not considered yet
  • rmdir: not considered yet
  • runcon: not considered yet
  • seq: not considered yet
  • shred: not considered yet
  • sleep: not considered yet
  • sort: at least --sort=month --sort=numeric is broken
  • split: not considered yet
  • stat: not considered yet
  • stdbuf: not considered yet
  • stty: not considered yet
  • sum: not considered yet
  • sync: not considered yet
  • tac: not considered yet
  • tail: not considered yet
  • tee: not considered yet
  • test: not considered yet
  • timeout: not considered yet
  • touch: not considered yet
  • truncate: not considered yet
  • tsort: not considered yet
  • tty: not considered yet
  • uname: not considered yet
  • unexpand: not considered yet
  • uniq: not considered yet
  • unlink: not considered yet
  • uptime: not considered yet
  • users: not considered yet
  • vdir: not considered yet
  • wc: not considered yet
  • who: not considered yet
Not a problem (solved / not affected / works already)
@tertsdiepraam
Copy link
Member

tertsdiepraam commented Feb 23, 2024

If I recall correctly, we fixed all of this with the args_override_self function in clap. What leads you to believe that this is broken?

@BenWiederhake
Copy link
Collaborator Author

BenWiederhake commented Feb 23, 2024

  • Only 11 tools use args_override_self, and gut feeling says that more than 11 tools have self-overriding flags
  • shuf used to use args_override_self and it was wrong
  • tr didn't have it yet
  • 2 out of 2 is a large enough rate to warrant making an issue out of it ^^

I didn't look much further into it yet. Now that I try out random other tools, it seems like you're right :D
I'll close this issue when I've checked all the tools.

EDIT: Oh! sort also doesn't work because it uses args_override_self:

$ ls | sort --sort=month --sort=numeric
sort: options '-Mn' are incompatible
[$? = 2]
$ ls | cargo run sort --sort=month --sort=numeric
CODE_OF_CONDUCT.md
COMMANDS.txt

@tertsdiepraam
Copy link
Member

Nice find :)

@BenWiederhake
Copy link
Collaborator Author

Ah, apparently I prevented auto-closing in the wrong way. Can someone re-open this issue? It'll be a long time until this issue can be closed.

@tertsdiepraam
Copy link
Member

I don't think an issue like this is the right approach. The problems should be fixed, but we should open issues for the problems we find, not for the potential problems we might find if that makes sense. An issue like this tends to go stale, becomes out of date, etc.

@BenWiederhake
Copy link
Collaborator Author

In principle I would usually agree with this argument, but given that 11 out of 12 tools that I looked at have at least one bug related to it, I'll continue using the above checklist.

Hmm. Actually, I think that answers it: Let's just keep this issue closed, because I can use the checklist anyway.

@tertsdiepraam
Copy link
Member

Yes, but usually different bugs right? I'd keep this open if the exact same issue was present in all utils. But yeah, feel free to keep using the checklist :)

@tertsdiepraam
Copy link
Member

Maybe we should reopen this. I got confused with other functionality and you're right that this should be checked for more utils.

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