Closed neithere closed 11 years ago
If I understand your use case correctly, it is already supported:
#!python
result = dispatch(p, output_file=None)
See the API reference.
If something is unclear or you have any further ideas, please don't hesitate reopening this issue. :-)
P.S.: note that only lines that would go to output_file
can be collected this way. Errors will still go to errors_file
(which default value is sys.stderr
).
Note: This comment has been automatically migrated from Bitbucket Created by @neithere on 2013-03-01 22:32:30+00:00
I like the default assumption to print to stdout. It’s the most common case, and it makes developing with argh faster.
However, I’ve stumbled upon a case where I want argh to dispatch a command, but then return the result of that function, so I can process it further. Is there a way to do this?
Note: This issue has been automatically migrated from Bitbucket Created by Zearin on 2013-03-01 16:49:30+00:00, last updated: 2013-03-01 22:32:30+00:00