-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.cgl
More file actions
50 lines (44 loc) · 1.14 KB
/
Copy pathexample.cgl
File metadata and controls
50 lines (44 loc) · 1.14 KB
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
# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Simon Geard
#
# example.cgl — sample graph definition for testing cmdgraph_gen.tcl
# kate: syntax Tcl/Tk;
initial root
state root {
prompt "> "
command {q(uit)} quit help "exit"
command {p(airs)} goto pairs help "manage pairs"
command {l(og)} goto log help "view log"
}
state pairs {
prompt "pairs> "
on_enter list_pairs
include nav
# Commands with arg specs
command {a(dd)} action act_add help "add a pair" {
arg id int
arg name char optional
}
command {d(elete)} action act_delete help "delete a pair" {
arg id int
}
command {s(elect)} do_goto detail act_select {
arg id int
}
}
state detail {
prompt "detail> "
include nav
command {u(pdate)} do_pop act_update help "update and return" {
arg name char
}
}
state log {
prompt "log> "
include nav
command {c(lear)} action act_clear help "clear the log"
}
# Abstract states are shared command sets with no prompt
abstract nav {
command {b(ack)} pop help "return to previous state"
}