← Back to issue list

Disable long option abbreviation (`--destructive` vs `--destructive-mode`)

View original Github issue

Metadata

Project
craft-cli
Number
#261
Type
issue
State
open
Author
mattculler
Labels
Created
2024-07-12 19:16:53+00:00
Updated
2025-03-10 18:59:04+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### 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.

Evaluation history

No evaluation history available.