We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4fe7c7a commit 130a5bfCopy full SHA for 130a5bf
README.md
@@ -56,6 +56,26 @@ $ python cli.py Alex --age 35 --greet
56
Hello Alex (35)!
57
```
58
59
+Alternatively, you can also use `Radicli.call`:
60
+
61
+```python
62
+# cli.py
63
+from radicli import Radicli, Arg
64
65
+def hello(name: str, age: int):
66
+ print(f"Hello {name} ({age})!")
67
68
+if __name__ == "__main__":
69
+ args = dict(name=Arg(help="Your name"), age=Arg("--age", "-a", help="Your age"))
70
+ command = Command.from_function("hello", args, hello)
71
+ Radicli().call(command)
72
+```
73
74
75
+$ python cli.py Alex --age 35
76
+Hello Alex (35)!
77
78
79
### Subcommands
80
81
`radicli` supports one level of nested subcommands. The parent command may exist independently, but it doesn't have to.
0 commit comments