← Back to issue list

hard to run help to figure out your args

View original Github issue

Metadata

Project
charmcraft
Number
#319
Type
issue
State
open
Author
jameinel
Labels
Created
Updated
Closed

Current evaluation

charmcraft's help command errors out when given extra/bad arguments (e.g. 'charmcraft help close --bad-args' or 'cmd --help extra'), instead of showing help for the named command. Maintainer acknowledged and filed craft-cli#68 to fix; still open and unaddressed.

Suggested action: keep open

Reason: Maintainer facundobatista acknowledged the issue (2021-11-03) and explicitly created canonical/craft-cli#68 (2022-03-07) to implement the desired behaviour, so it is triaged and valid. The underlying 'Too many parameters when requesting help' error still exists in craft_cli/dispatcher.py, so the issue remains relevant and is effectively blocked on the upstream craft-cli change rather than stale.

Impact: 30 Quick Win: 18.0 Staleness: 60 Complexity: 40 Confidence: 85 Support Request: 10

Issue body

I don't know how hard this is to do differently but I was doing: ``` charmcraft command bad args ``` And then to figure out how to make it better I added: ``` charmcraft command bad args --help charmcraft command --help bad args charmcraft help command bad args ``` But all of them come back with: ``` $ charmcraft upload-resource --help jam-k8s-api-sidecar-test ubuntu ubuntu:latest Usage: charmcraft [options] command [args]... Try 'charmcraft help -h' for help. Error: unrecognized arguments: jam-k8s-api-sidecar-test ubuntu ubuntu:latest ``` I can, certainly run just ``` charmcraft help upload-resource ``` But my natural instinct is to go up one and then add --help to try and figure out what I did wrong. Especially unhelpful is that if I have a correctly formatted command and add --help: ``` $ charmcraft upload-resource jam-k8s-api-sidecar-test ubuntu --help Usage: charmcraft [options] command [args]... Try 'charmcraft help -h' for help. Error: unrecognized arguments: jam-k8s-api-sidecar-test ubuntu ``` It seems the parser looks for help/--help/-h and then switches to the 'help' command, but that doesn't allow you to pass any extra arguments. It might be cleaner if we just change the help command to take any arguments (but ignore them), and then you can actually get the help on a command that you've started writing.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 30
Quick Win: 18.0
Staleness: 60
Complexity: 40
Confidence: 85
Support Request: 10
keep open charmcraft's help command errors out when given extra/bad arguments (e.g. 'charmcraft help close --bad-args' or 'cmd --help extra'), instead of showing help for the named command. Maintainer acknowledged and filed craft-cli#68 to fix; still open and unaddressed.
qwen/qwen3.6-35b-a3b
Staleness: 65
Complexity: 20
Confidence: 85
Support Request: 5
keep open CLI help command fails when extra arguments are provided, causing confusing error messages. Maintainer acknowledged the UX flaw and filed an upstream fix in craft-cli, with an internal Jira ticket created.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 25
Confidence: 75
Support Request: 10
close stale CLI help command fails with unrecognized arguments when extra flags are passed; triaged and linked to an external craft-cli dependency, but inactive for over 5 years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 70
Complexity: 20
Confidence: 85
Support Request: 0
keep open CLI help command fails when combined with arguments, causing confusing error messages. Maintainer acknowledged the UX flaw and filed a downstream issue in craft-cli to fix argument parsing behavior.
qwen3.6-35b-a3b-mtp-q6
Staleness: 80
Complexity: 15
Confidence: 85
Support Request: 0
keep open Help command rejects extra or invalid arguments even when a valid subcommand is present. Requesting it ignore extra args to show relevant help. Related craft-cli issue opened and internal ticket CRAFT-3414 created to track the upstream fix.

Update history

No update history recorded yet.

Related work

  • Blocked By: canonical/craft-cli#68 (confidence 90%)

    Maintainer created this craft-cli issue to get the behaviour where help ignores trailing bad args; it is still open and untriaged, and the 'Too many parameters' error persists in craft_cli/dispatcher.py.

Related issues

Issue Project State Summary Similarity
#68 Better output information when requesting help for a command with bad arguments for that command craft-cli open craft-cli help command errors with 'Too many parameters' when given a valid command name plus an invalid option (e.g. `charmcraft help close --bad-args`); it should show help for the named command. Still unfixed in current code; no maintainer triage, only a Jira-sync bot comment.
82%