MCPcopy
hub / github.com/spf13/cobra / shortHasNoOptDefVal

Function shortHasNoOptDefVal

command.go:662–672  ·  view source on GitHub ↗
(name string, fs *flag.FlagSet)

Source from the content-addressed store, hash-verified

660}
661
662func shortHasNoOptDefVal(name string, fs *flag.FlagSet) bool {
663 if len(name) == 0 {
664 return false
665 }
666
667 flag := fs.ShorthandLookup(name[:1])
668 if flag == nil {
669 return false
670 }
671 return flag.NoOptDefVal != ""
672}
673
674func stripFlags(args []string, c *Command) []string {
675 if len(args) == 0 {

Callers 3

stripFlagsFunction · 0.85
argsMinusFirstXMethod · 0.85
TraverseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected