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

Disable long option abbreviation (--destructive vs --destructive-mode) #261

Open
mattculler opened this issue Jul 12, 2024 · 1 comment
Open
Labels
Bug Something isn't working triaged Will be worked on at some point

Comments

@mattculler
Copy link
Contributor

What needs to get done

By default, argparse allows abbreviated commands, such as --destructive-mode being specified as --destructive.

Since Python 3.5, this default behavior can be disabled by setting allow_abbrev=False when instantiating argparse.ArgumentParser:

https://docs.python.org/3/library/argparse.html#allow-abbrev

Found by @thp-canonical and @Ardelean-Calin

Why it needs to get done

This avoids wrongly learning command-line arguments that might at some point not be unique anymore.

@tigarmo tigarmo added Bug Something isn't working triaged Will be worked on at some point labels Jul 12, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3114.

This message was autogenerated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working triaged Will be worked on at some point
Projects
None yet
Development

No branches or pull requests

2 participants