MCPcopy
hub / github.com/livebud/bud / setFlags

Method setFlags

package/commander/subcommand.go:55–66  ·  view source on GitHub ↗

Set flags only once

()

Source from the content-addressed store, hash-verified

53
54// Set flags only once
55func (c *Subcommand) setFlags() {
56 if c.parsed {
57 return
58 }
59 c.parsed = true
60 for _, flag := range c.flags {
61 c.fset.Var(flag.value, flag.name, flag.usage)
62 if flag.short != 0 {
63 c.fset.Var(flag.value, string(flag.short), flag.usage)
64 }
65 }
66}
67
68func (c *Subcommand) parse(ctx context.Context, args []string) error {
69 // Set flags

Callers 1

parseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected