8000 GNU utilities match unambiguous prefixes of long options but uutils utilities don't · Issue #2931 · uutils/coreutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

GNU utilities match unambiguous prefixes of long options but uutils utilities don't #2931

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

Closed
jfinkels opened this issue Jan 28, 2022 · 1 comment · Fixed by #2936
Closed

Comments

@jfinkels
Copy link
Collaborator

I'm testing with GNU coreutils v8.30

The GNU utilities seem to have a feature where a long option is inferred from an unambiguous prefix. For example:

$ seq -s : --e 10
01:02:03:04:05:06:07:08:09:10
$ seq -s : --eq 10
01:02:03:04:05:06:07:08:09:10
$ seq -s : --equ 10
01:02:03:04:05:06:07:08:09:10
$ seq -s : --equa 10
01:02:03:04:05:06:07:08:09:10
$ seq -s : --equal 10
01:02:03:04:05:06:07:08:09:10
$ seq -s : --equal- 10
01:02:03:04:05:06:07:08:09:10
$ seq -s : --equal-wid 10
01:02:03:04:05:06:07:08:09:10
$ seq -s : --equal-widt 10
01:02:03:04:05:06:07:08:09:10
$ seq -s : --equal-width 10
01:02:03:04:05:06:07:08:09:10

And an ambiguous prefix results in a usage error message. For example:

$ split --lin 10
split: option '--lin' is ambiguous; possibilities: '--lines' '--line-bytes'
Try 'split --help' for more information.

This is causing test errors in the GNU test suite. One that I found is in tests/split/suffix-auto-length.sh. In that test, split --numeric is used, but the full name of the long option is --numeric-suffixes.

@tertsdiepraam
Copy link
Member

That's right! This issue had been blocked for a long long time, because it required a change to clap, so I opened a PR there(clap-rs/clap#2525) to add AppSettings::InferLongArgs. But clap took a long time to release version 3 and so we had to wait, but now we are using clap 3, so this is now possible.

As a workaround we also had some aliases of shorter names, so those should be removed once InferLongArgs is added.

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 a pull request may close this issue.

2 participants
0