Skip to content

Refactor and standardize argparse-related naming and metadata#1670

Open
kmvanbrunt wants to merge 11 commits into
mainfrom
ap_command_spec
Open

Refactor and standardize argparse-related naming and metadata#1670
kmvanbrunt wants to merge 11 commits into
mainfrom
ap_command_spec

Conversation

@kmvanbrunt
Copy link
Copy Markdown
Member

@kmvanbrunt kmvanbrunt commented May 28, 2026

  • Consistently use full words COMMAND and SUBCOMMAND over abbreviations
  • Rename cmd2_subcmd_handler to cmd2_subcommand_func for consistency
  • Consolidate command metadata into ArgparseCommandSpec dataclass
  • Simplify subcommand examples by using required=True for subparsers
  • Renamed set_default_argument_parser_type() to set_default_argument_parser().
  • Renamed set_default_ap_completer_type() to set_default_argparse_completer().
  • Renamed Cmd2ArgumentParser.ap_completer_type to completer_class.

- Consistently use full words COMMAND and SUBCOMMAND over abbreviations
- Rename cmd2_subcmd_handler to cmd2_subcommand_func for consistency
- Consolidate command metadata into ApCommandSpec dataclass
- Simplify subcommand examples by using required=True for subparsers
@kmvanbrunt kmvanbrunt requested a review from tleonhardt as a code owner May 28, 2026 02:06
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

❌ Patch coverage is 97.29730% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.54%. Comparing base (1288fb6) to head (a1c99e0).

Files with missing lines Patch % Lines
cmd2/annotated.py 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1670      +/-   ##
==========================================
+ Coverage   99.50%   99.54%   +0.03%     
==========================================
  Files          23       23              
  Lines        5682     5675       -7     
==========================================
- Hits         5654     5649       -5     
+ Misses         28       26       -2     
Flag Coverage Δ
unittests 99.54% <97.29%> (+0.03%) ⬆️

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

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

@kmvanbrunt kmvanbrunt marked this pull request as draft May 28, 2026 03:49
tleonhardt
tleonhardt previously approved these changes May 28, 2026
This is to match what it's called in the Namespace when using with_argparser.
…rser().

Renamed set_default_ap_completer_type() to set_default_argparse_completer().
Renamed Cmd2ArgumentParser.ap_completer_type to completer_class.
@kmvanbrunt kmvanbrunt changed the title Standardized command/subcommand naming and metadata Standardized naming and metadata for argparse-related classes and functions. Jun 4, 2026
@kmvanbrunt kmvanbrunt changed the title Standardized naming and metadata for argparse-related classes and functions. Refactor and standardize argparse-related naming and metadata Jun 4, 2026
@kmvanbrunt kmvanbrunt marked this pull request as ready for review June 4, 2026 06:56
…ENT_PARSER.

Added test for set_default_argument_parser().
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.

2 participants