MCPcopy Index your code
hub / github.com/cloudfoundry/cli / FlagWithHyphens

Function FlagWithHyphens

command/common/internal/help_display.go:82–91  ·  view source on GitHub ↗
(flag sharedaction.CommandFlag)

Source from the content-addressed store, hash-verified

80}
81
82func FlagWithHyphens(flag sharedaction.CommandFlag) string {
83 switch {
84 case flag.Short != "" && flag.Long != "":
85 return fmt.Sprintf("--%s, -%s", flag.Long, flag.Short)
86 case flag.Short != "":
87 return "-" + flag.Short
88 default:
89 return "--" + flag.Long
90 }
91}

Callers 2

displayCommandMethod · 0.92
LongestFlagWidthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected