Skip to content

Conversation

tleonhardt
Copy link
Member

Various updates to examples in the examples/ directory.

kmvanbrunt and others added 12 commits August 21, 2025 12:35
…xample instead of manually copying it by hand
The following 4 examples all demonstrate various aspects of using `argparse` for command argument processing and have been merged into a single comprehensive example called `argparse_example.py`:
- arg_decorators.py
- decorator_example.py
- arg_print.py
- subcommands.py

`first_app.py` and `initialization.py` had a lot of overlap in demonstrating basic features of cmd2. I combined them into a single `getting_started.py` example
command_sets.py merges three previous examples:
- modular_commands_basic.py
- modular_commands_dynamic.py
- modular_subcommands.py
@tleonhardt tleonhardt requested a review from kmvanbrunt as a code owner August 23, 2025 21:22
Copy link

codecov bot commented Aug 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.75%. Comparing base (5d49d55) to head (b3dd76a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1485   +/-   ##
=======================================
  Coverage   98.75%   98.75%           
=======================================
  Files          23       23           
  Lines        4901     4901           
=======================================
  Hits         4840     4840           
  Misses         61       61           
Flag Coverage Δ
unittests 98.75% <ø> (ø)

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 previously approved these changes Aug 23, 2025
Copy link
Member

@kmvanbrunt kmvanbrunt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good so far. We'll probably want to go back and update the subcommand stuff.
The @as_subcommand_to decorator is a lot easier.

@tleonhardt tleonhardt merged commit c43d987 into main Aug 23, 2025
30 checks passed
@tleonhardt tleonhardt deleted the update_examples branch August 23, 2025 23:06
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