-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
97 lines (86 loc) · 2.1 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Compiling "hello-cli":
======================
$
$ mkdir demo
$
$
$ cd demo
demo$
demo$
demo$ git clone https://github.com/spog/u2up-cli-demo.git
Cloning into 'u2up-cli-demo'...
remote: Enumerating objects: 128, done.
remote: Counting objects: 100% (128/128), done.
remote: Compressing objects: 100% (77/77), done.
remote: Total 128 (delta 63), reused 112 (delta 47), pack-reused 0
Receiving objects: 100% (128/128), 46.03 KiB | 628.00 KiB/s, done.
Resolving deltas: 100% (63/63), done.
demo$
demo$
demo$ cd u2up-cli-demo
demo/u2up-cli-demo$
demo/u2up-cli-demo$
demo/u2up-cli-demo$ gcc -o hello-cli -I ./include -DU2UP_LOG_MODULE_DEBUG=1 -DU2UP_LOG_MODULE_TRACE=1 -g hello-cli.c
demo/u2up-cli-demo$
demo/u2up-cli-demo$
demo/u2up-cli-demo$ ls -la
skupno 448
drwxr-xr-x 4 samo samo 4096 maj 22 19:58 .
drwxr-xr-x 3 samo samo 4096 maj 22 19:57 ..
drwxr-xr-x 8 samo samo 4096 maj 22 19:57 .git
-rwxr-xr-x 1 samo samo 403296 maj 22 19:58 hello-cli
-rw-r--r-- 1 samo samo 16455 maj 22 19:57 hello-cli.c
drwxr-xr-x 4 samo samo 4096 maj 22 19:57 include
-rw-r--r-- 1 samo samo 10175 maj 22 19:57 LICENSE
-rw-r--r-- 1 samo samo 3281 maj 22 19:57 README
demo/u2up-cli-demo$
Running "hello-cli":
====================
demo/u2up-cli-demo$
demo/u2up-cli-demo$ ./hello-cli
hello-cli>
hello-cli> help
help command handle called!'
Press TAB-TAB to display all available commands.
Use TAB for auto-complete.
Use TAB-TAB for auto-suggest.
Use UP and DOWN keys to walk the commands history.
hello-cli>
help
action1
action2
action3
action4
obj1
obj2
quit
hello-cli> action
action1
action2
action3
action4
hello-cli> action1
[str=%s]
hello-cli> action1
action1: command handle called!'
hello-cli>
hello-cli> action1 str=hello
action1: command handle called!'
action1 command handle: str=hello
hello-cli>
hello-cli> action2
obj1
obj2
hello-cli> action2 obj
obj1
obj2
hello-cli> action2 obj1
{aa=%8x | ab=%u}
hello-cli> action2 obj1 aa=f1bedac
action2 obj1: command handle called!'
action2 obj1: command parameter (aa=0f1bedac)!'
hello-cli>
hello-cli> quit
quit command handle called!'
Bye...
demo/u2up-cli-demo$