← 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
Updated
Closed

Current evaluation

Feature request to set allow_abbrev=False on craft-cli's ArgumentParser to disable argparse long-option abbreviation (e.g. --destructive matching --destructive-mode). Open, unlabelled, unassigned; only a Jira-sync bot comment; code still lacks the flag.

Suggested action: needs triage

Reason: The issue has no labels, no assignee, and no maintainer response — the only comment is an autogenerated Jira-sync bot message (CRAFT-3114). The underlying problem is still live in the code: neither _CustomArgumentParser in craft_cli/dispatcher.py nor the parsers in craft_cli/completion/completion.py set allow_abbrev=False, and no commit has addressed it. It needs a maintainer to categorise and prioritise it.

Impact: 25 Quick Win: 17.5 Staleness: 75 Complexity: 30 Confidence: 78 Support Request: 10

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

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 25
Quick Win: 17.5
Staleness: 75
Complexity: 30
Confidence: 78
Support Request: 10
needs triage Feature request to set allow_abbrev=False on craft-cli's ArgumentParser to disable argparse long-option abbreviation (e.g. --destructive matching --destructive-mode). Open, unlabelled, unassigned; only a Jira-sync bot comment; code still lacks the flag.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 15
Confidence: 75
Support Request: 10
needs triage Request to disable argparse long option abbreviation via allow_abbrev=False to prevent future CLI ambiguity. Currently unlabelled, unassigned, and inactive for over a year with only a Jira sync bot comment.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 10
Confidence: 80
Support Request: 10
needs triage Request to disable argparse long option abbreviation by setting allow_abbrev=False to prevent ambiguous CLI parsing. Currently unlabelled and inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 10
Confidence: 80
Support Request: 5
needs triage Proposes disabling argparse long option abbreviation via allow_abbrev=False to prevent ambiguous CLI arguments. Internal Jira ticket CRAFT-3114 created. Issue remains open with no recent activity since July 2024.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.