PersistentFlags returns the persistent FlagSet specifically set in the current command.
()
| 1773 | |
| 1774 | // PersistentFlags returns the persistent FlagSet specifically set in the current command. |
| 1775 | func (c *Command) PersistentFlags() *flag.FlagSet { |
| 1776 | if c.pflags == nil { |
| 1777 | c.pflags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) |
| 1778 | if c.flagErrorBuf == nil { |
| 1779 | c.flagErrorBuf = new(bytes.Buffer) |
| 1780 | } |
| 1781 | c.pflags.SetOutput(c.flagErrorBuf) |
| 1782 | } |
| 1783 | return c.pflags |
| 1784 | } |
| 1785 | |
| 1786 | // ResetFlags deletes all flags from command. |
| 1787 | func (c *Command) ResetFlags() { |