Skip to content

Validate subparser class and remove default subcommand title#1636

Merged
kmvanbrunt merged 4 commits intomainfrom
argparse_tweaks
Apr 17, 2026
Merged

Validate subparser class and remove default subcommand title#1636
kmvanbrunt merged 4 commits intomainfrom
argparse_tweaks

Conversation

@kmvanbrunt
Copy link
Copy Markdown
Member

@kmvanbrunt kmvanbrunt commented Apr 17, 2026

  • Improved attach_subcommand() by validating that attached parsers are
    Cmd2ArgumentParser instances and match the subparsers group's
    parser_class.

  • Removed default 'subcommands' title from add_subparsers() to align
    with standard argparse behavior.

@kmvanbrunt kmvanbrunt requested a review from tleonhardt as a code owner April 17, 2026 18:25
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.51%. Comparing base (b2b888c) to head (156d158).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1636   +/-   ##
=======================================
  Coverage   99.51%   99.51%           
=======================================
  Files          21       21           
  Lines        4699     4699           
=======================================
  Hits         4676     4676           
  Misses         23       23           
Flag Coverage Δ
unittests 99.51% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kmvanbrunt kmvanbrunt changed the title Argparse tweaks argparse_custom tweaks Apr 17, 2026
@kmvanbrunt kmvanbrunt changed the title argparse_custom tweaks Check attached subparser type. Apr 17, 2026
@kmvanbrunt kmvanbrunt changed the title Check attached subparser type. Validate subparser class and remove default subcommand title Apr 17, 2026
@kmvanbrunt kmvanbrunt merged commit 41eef55 into main Apr 17, 2026
33 checks passed
@kmvanbrunt kmvanbrunt deleted the argparse_tweaks branch April 17, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant