File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,26 @@ The plugin-based architecture is very flexible and allows for a wide range of us
2727``` nim
2828import kapsis
2929
30+ #
31+ # Command definitions
32+ #
33+ proc helloCommand(v: Values) =
34+ echo v.get("pkgname").getStr
35+
36+ proc greetCommand(v: Values) =
37+ if v.has("greeting"):
38+ echo v.get("greeting").getStr
39+ echo v.get("name").getStr
40+
41+ proc colorsRedCommand(v: Values) =
42+ echo "Red color command, name: ", v.get("name").getStr
43+
44+ proc colorsBlueCommand(v: Values) =
45+ echo "Blue color command, name: ", v.get("name").getStr
46+
47+ #
48+ # Kapsis initialization
49+ #
3050initKapsis do:
3151 commands do:
3252 -- "Crazy stuff"
@@ -39,9 +59,10 @@ initKapsis do:
3959
4060 -- "Subcommand example"
4161 colors:
42- red:
62+ ## Colors command with subcommands
63+ red string(name):
4364 ## Red color command
44- blue:
65+ blue string(name) :
4566 ## Blue color command
4667```
4768
You can’t perform that action at this time.
0 commit comments