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

Method VisiblePersistentFlags

command.go:296–309  ·  view source on GitHub ↗

VisiblePersistentFlags returns a slice of [LocalFlag] with Persistent=true and Hidden=false.

()

Source from the content-addressed store, hash-verified

294
295// VisiblePersistentFlags returns a slice of [LocalFlag] with Persistent=true and Hidden=false.
296func (cmd *Command) VisiblePersistentFlags() []Flag {
297 if cmd.isCompletionCommand {
298 return nil
299 }
300 var flags []Flag
301 for _, fl := range cmd.Root().Flags {
302 pfl, ok := fl.(LocalFlag)
303 if !ok || pfl.IsLocal() {
304 continue
305 }
306 flags = append(flags, fl)
307 }
308 return visibleFlags(flags)
309}
310
311func (cmd *Command) appendCommand(aCmd *Command) {
312 if !slices.Contains(cmd.Commands, aCmd) {

Callers

nothing calls this directly

Calls 3

RootMethod · 0.95
visibleFlagsFunction · 0.85
IsLocalMethod · 0.65

Tested by

no test coverage detected