command: implement help builder
All checks were successful
Test / Create distribution (push) Successful in 25s
Test / Run NixOS test (push) Successful in 3m28s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-02-22 22:06:02 +09:00
parent 7bd48d3489
commit 8000a2febb
3 changed files with 58 additions and 2 deletions

View File

@@ -1,7 +1,10 @@
// Package command implements generic nested command parsing.
package command
import "flag"
import (
"flag"
"strings"
)
type (
// HandlerFunc is called when matching a directly handled subcommand tree.
@@ -13,7 +16,7 @@ type (
// FlagDefiner is a deferred flag definer value, usually encapsulating the default value.
FlagDefiner interface {
// Define defines the flag in set.
Define(set *flag.FlagSet, p any, name, usage string)
Define(b *strings.Builder, set *flag.FlagSet, p any, name, usage string)
}
Command interface {