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 unambiguous shortened long-options #36

Closed
chungy opened this issue Sep 20, 2019 · 2 comments
Closed

Allow unambiguous shortened long-options #36

chungy opened this issue Sep 20, 2019 · 2 comments

Comments

@chungy
Copy link

chungy commented Sep 20, 2019

With GNU getopt and friends (I believe Python argparse included, but I haven't tested it to write this issue report), long options may be abbreviated to the shortest unambiguous version and needn't be typed in full.

For example, in a program that has both --verbose and --version, --ver cannot work since it would match either of them, but --vers would act the same as --version, and --verb would act the same as --verbose.

@densestvoid
Copy link
Contributor

Python argparse confirmed, according to https://docs.python.org/3/library/argparse.html, allow_abbrev is a parameter for ArgumentParser object.

@akamensky
Copy link
Owner

I don't think that is necessary. This adds ambiguity to the options as well as adds on complexity of parsing.

This library is inspired by argparse, it does not intent on copying it 100% (which would not be possible anyway because of strict typing).

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

No branches or pull requests

3 participants