Skip to content
This repository has been archived by the owner on Jan 1, 2022. It is now read-only.

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

Open
2 tasks done
epage opened this issue Dec 6, 2021 · 0 comments
Open
2 tasks done

Comments

@epage
Copy link
Owner

epage commented Dec 6, 2021

Issue by fishface60
Tuesday Oct 12, 2021 at 20:49 GMT
Originally opened as clap-rs/clap#2864


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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant