MCPcopy
hub / github.com/urfave/cli / fishSubcommandHelper

Function fishSubcommandHelper

fish.go:179–194  ·  fish.go::fishSubcommandHelper
(binary string, command *Command, siblings []*Command)

Source from the content-addressed store, hash-verified

177}
178
179func fishSubcommandHelper(binary string, command *Command, siblings []*Command) string {
180 fishHelper := fmt.Sprintf("__fish_%s_no_subcommand", binary)
181 if len(command.Lineage()) > 1 {
182 var siblingNames []string
183 for _, sibling := range siblings {
184 siblingNames = append(siblingNames, sibling.Names()...)
185 }
186 ancestry := commandAncestry(command)
187 fishHelper = fmt.Sprintf(
188 "%s; and not __fish_seen_subcommand_from %s",
189 ancestry,
190 strings.Join(siblingNames, " "),
191 )
192 }
193 return fishHelper
194}
195
196func fishFlagHelper(binary string, command *Command) string {
197 fishHelper := fmt.Sprintf("__fish_%s_no_subcommand", binary)

Callers 1

prepareFishCommandsFunction · 0.85

Calls 3

commandAncestryFunction · 0.85
LineageMethod · 0.80
NamesMethod · 0.65

Tested by

no test coverage detected