Replies: 1 comment
-
Small PR submitted! 🙂 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Click to show checkboxes
First Check
Commit to Help
Example Code
I want to run a function
step_1
in a moduleone
in packageautocli
like this:but I can only run it with the explicit
--func
flag:$ typer --func=step_1 'autocli.one' run 123 Step 1: Processing with a=123, result=processed_123.txt
For reference the demo module is:
Description
The
maybe_update_state
function treats the input string totyper run
as a "path or module", but does not support:
to also append a specific function:typer/typer/cli.py
Lines 43 to 61 in 3b17788
It could instead parse the
path_or_module:function_name
syntax by adding thismaking it
With this small change the above example would work 🎉
$ typer 'autocli.one:step_1' run 123 Step 1: Processing with a=123, result=processed_123.txt $ typer src/autocli/one.py:step_1 run 123 Step 1: Processing with a=123, result=processed_123.txt
Operating System
Linux
Operating System Details
No response
Typer Version
0.16.0
Python Version
Python 3.13.3
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions