← 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

Command help should ignore extra or invalid arguments and still show help for the named command; maintainers moved implementation to canonical/craft-cli#68, which remains open.

Suggested action: keep open

Reason: Maintainer facundobatista explicitly identified this as incomplete UX and created canonical/craft-cli#68 to implement help whenever any requested parameter identifies a command. The issue has exact reproductions and remains blocked on that open upstream work, so it is valid despite its age.

Evaluated by: mr-cal-bot

Impact: 32 Quick Win: 12 Complexity: 57 Confidence: 92 Actionability: 84

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
stealth/space-bunny-alpha
Impact: 32
Quick Win: 12
Complexity: 57
Confidence: 92
Actionability: 84
keep open Command help should ignore extra or invalid arguments and still show help for the named command; maintainers moved implementation to canonical/craft-cli#68, which remains open.
stealth/space-bunny-alpha
Impact: 43
Quick Win: 17
Complexity: 56
Confidence: 97
Actionability: 89
keep open Charmcraft still rejects extra positional arguments when requesting command help; maintainers moved the underlying parser enhancement to canonical/craft-cli#68.
qwen/qwen3.6-35b-a3b
Impact: 40
Quick Win: 15
Complexity: 50
Confidence: 75
Actionability: 75
keep open Help command doesn't accept arguments when invoked as `charmcraft command --help` or `charmcraft help command --bad-args`. Maintainer acknowledged and created craft-cli#68 to track the fix.
qwen/qwen3.8-27b
Impact: 30
Quick Win: 18
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.

Update history

No update history recorded yet.

Related work

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

    A maintainer created this upstream issue for the requested help-parsing behavior.

Related issues

No related issues found above the similarity threshold.