Skip to content

Added ability to pass a console object to Cmd.print_to().#1592

Open
kmvanbrunt wants to merge 3 commits into3.xfrom
print_to_console
Open

Added ability to pass a console object to Cmd.print_to().#1592
kmvanbrunt wants to merge 3 commits into3.xfrom
print_to_console

Conversation

@kmvanbrunt
Copy link
Member

See #1578

@github-actions
Copy link
Contributor

🤖 Hi @kmvanbrunt, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (3.x@6c48851). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff           @@
##             3.x    #1592   +/-   ##
======================================
  Coverage       ?   99.23%           
======================================
  Files          ?       21           
  Lines          ?     4848           
  Branches       ?        0           
======================================
  Hits           ?     4811           
  Misses         ?       37           
  Partials       ?        0           
Flag Coverage Δ
unittests 99.23% <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.

@github-actions
Copy link
Contributor

🤖 I'm sorry @kmvanbrunt, but I was unable to process your request. Please see the logs for more details.

- Enhancements
- Added ability to pass a console object to `Cmd.print_to()`. This provides support for things
like wrapping a `print_to()` call in a `console.status()` or `console.capture()` context
manager.
Copy link
Member

Choose a reason for hiding this comment

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

We should document that the file parameter of cmd2.Cmd.print_to has been renamed to destination and that this is a potentially breaking change.

As such we should probably make it a 3.3.0 release instead of 3.2.3.

@tleonhardt
Copy link
Member

After this merges, we should cherry-pick changes to main

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