LocalNonPersistentFlags are flags specific to this command which will NOT persist to subcommands. This function does not modify the flags of the current command, it's purpose is to return the current state.
()
| 1700 | // LocalNonPersistentFlags are flags specific to this command which will NOT persist to subcommands. |
| 1701 | // This function does not modify the flags of the current command, it's purpose is to return the current state. |
| 1702 | func (c *Command) LocalNonPersistentFlags() *flag.FlagSet { |
| 1703 | persistentFlags := c.PersistentFlags() |
| 1704 | |
| 1705 | out := flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) |
| 1706 | c.LocalFlags().VisitAll(func(f *flag.Flag) { |
| 1707 | if persistentFlags.Lookup(f.Name) == nil { |
| 1708 | out.AddFlag(f) |
| 1709 | } |
| 1710 | }) |
| 1711 | return out |
| 1712 | } |
| 1713 | |
| 1714 | // LocalFlags returns the local FlagSet specifically set in the current command. |
| 1715 | // This function does not modify the flags of the current command, it's purpose is to return the current state. |
no test coverage detected