Skip to content

Commit e4fd9c9

Browse files
committed
update
Signed-off-by: George Lemon <georgelemon@protonmail.com>
1 parent 01d3481 commit e4fd9c9

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,26 @@ The plugin-based architecture is very flexible and allows for a wide range of us
2727
```nim
2828
import 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+
#
3050
initKapsis 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

0 commit comments

Comments
 (0)