diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-02-22 23:11:17 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-02-22 23:11:17 +0900 |
| commit | dfa3217037d8c24181be24484892ecb950a2a5ba (patch) | |
| tree | e2022ad6ce2e11bbb7b4d0b38731a6c67561235f /command/wrap.go | |
| parent | 8000a2febb546b3b68eddd9330d5709281068e9f (diff) | |
command: implement builder and parser
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'command/wrap.go')
| -rw-r--r-- | command/wrap.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/command/wrap.go b/command/wrap.go new file mode 100644 index 00000000..ee08a61a --- /dev/null +++ b/command/wrap.go @@ -0,0 +1,14 @@ +package command + +// the top level node wants [Command] returned for its builder methods +type rootNode struct{ *node } + +func (r rootNode) Command(name, usage string, f HandlerFunc) Command { + r.node.Command(name, usage, f) + return r +} + +func (r rootNode) Flag(p any, name string, value FlagDefiner, usage string) Command { + r.node.Flag(p, name, value, usage) + return r +} |
