docs: fix parameter names showing as None in CLI usage docs#2671
Draft
docs: fix parameter names showing as None in CLI usage docs#2671
Conversation
Required arguments with no explicit metavar were displaying as <None> in the generated command reference docs. Fix by falling back to the argparse convention: positional args use dest, optional args use dest.upper(). Fixes #2578 Fixes #2642 Agent-Logs-Url: https://github.com/canonical/charmcraft/sessions/214f19c4-3b9e-4123-9e2d-d2fc75b2ca6d Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
lengau
April 22, 2026 04:52
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tools/docs/gen_cli_docs.py: required argument metavars show as<None>in usage strings whenmetavaris not explicitly set (fixes docs: The usage parameters show up as None #2578, Small bug incharmcraft releasedocumentation #2642)dest, optional args usedest.upper()action_requiredstate (needs maintainer approval - standard for Copilot PRs)Other CI failures found on main (documented below, no simple fix in charmcraft):
snap-store-testsfailing: Charmhub credentials expired (infrastructure issue)snap-tests (ubuntu-22.04/20.04):smoketests/different-dir-metadatafails due to craft_providers snapd initialization issue (upstream issue in craft_providers; see PR Investigation: Spread test failures are due to craft_providers snapd initialization issue #2509)snap-tests (ubuntu-26.04): Transient apt package unavailability on Ubuntu devel daily builds (gccandpython3-devnot found) — not fixable in charmcraft