command: implement builder and parser
All checks were successful
Test / Create distribution (push) Successful in 20s
Test / Run NixOS test (push) Successful in 2m47s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-02-22 23:11:17 +09:00
parent 8000a2febb
commit dfa3217037
7 changed files with 595 additions and 0 deletions

14
command/wrap.go Normal file
View File

@@ -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
}