← Back to issue list

fix: better help for invalid command args

View original Github issue

Metadata

Project
craft-application
Number
#95
Type
pull request
State
merged
Author
tigarmo
Labels
Created
Updated
Closed

Current evaluation

Merged into main after approval and CI checks. Resolves #89 by replacing the internal error for invalid command arguments with the standard help message, matching dispatcher behavior. Changes span 3 files with 100% diff coverage.

Suggested action:

No scores available.

Issue body

Instead of handling it like an internal error, present the help message as we do in _get_dispatcher() (for e.g. invalid commands) and return the same return code. Fixes #89 - [ ] Have you followed the guidelines for contributing? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `tox`? -----

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged into main after approval and CI checks. Resolves #89 by replacing the internal error for invalid command arguments with the standard help message, matching dispatcher behavior. Changes span 3 files with 100% diff coverage.
qwen3.6-35b-a3b-mtp-q6 Merged into main. Replaces internal error handling for invalid command arguments with a help message, matching dispatcher behavior. Resolves #89. Changes achieved 100% test coverage.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#163 Two small details before integrating help messages to main. charmcraft merged Merged after two approvals. Added an argsparsing option to CommandError for immediate help display and a helper to check command arguments. Modified four files with minor adjustments to prepare for a larger message refactoring.
73%
#84 fix(cli): enable per-command help queries craft-application merged Merged to main, enabling per-command help queries in the CLI and resolving issue #76. Approved by two reviewers, passed CI checks, and achieved 100% diff coverage across three files.
72%
#96 fix: merge command groups with the same name craft-application merged Merged into main after three approvals. Consolidates identically named command groups to clean up help output, resolving issue #94. The change adds 41 lines and removes 1 across two files, achieving 100% test coverage.
72%
#5178 fix: properly present help when posargs have no help snapcraft merged Merged fix for help display when positional arguments lack descriptions. Approved by two reviewers, passed CI, and applied with minimal changes across four files.
71%