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

Multicall executables should support matching argv[0] with a prefix stripped off #2864

Closed
2 tasks done
Tracked by #215 ...
fishface60 opened this issue Oct 12, 2021 · 0 comments · Fixed by #3041
Closed
2 tasks done
Tracked by #215 ...

Multicall executables should support matching argv[0] with a prefix stripped off #2864

fishface60 opened this issue Oct 12, 2021 · 0 comments · Fixed by #3041
Labels
A-parsing Area: Parser's logic and needs it changed somehow. C-enhancement Category: Raise on the bar on expectations

Comments

@fishface60
Copy link
Contributor

Please complete the following tasks

  • I have searched the discussions
  • I have searched the existing issues

Clap Version

3.0.0-beta.4

Describe your use case

The implementation of multicall needs to match the executable name against the program's name or any applets.
If it doesn't match any then it treats it as the applet not being found.

It should not be required for the executable name to match applet names exactly.

It's not uncommon for a program to be installed with a custom prefix added to the binary name
e.g. GNU coreutils being installed prefixed with g e.g. gcp on non-GNU unix systems, or https://github.com/uutils/coreutils/ installing as uu-cp.

Describe the solution you'd like

uutils handles it by stripping off any string that ends with a non-alphanumeric character https://github.com/uutils/coreutils/blob/40a895f79dca20b06fbec365038655a4031e90d0/src/bin/coreutils.rs#L64
however this wouldn't handle gcp.

Alternatives, if applicable

It could be built with a predetermined prefix rather than programmatically inferring a prefix to strip, in the style of coreutils' ./configure file's --program-prefix, --program-suffix or --program-transform-name options.

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parsing Area: Parser's logic and needs it changed somehow. C-enhancement Category: Raise on the bar on expectations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants