ResetFlags deletes all flags from command.
()
| 1785 | |
| 1786 | // ResetFlags deletes all flags from command. |
| 1787 | func (c *Command) ResetFlags() { |
| 1788 | c.flagErrorBuf = new(bytes.Buffer) |
| 1789 | c.flagErrorBuf.Reset() |
| 1790 | c.flags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) |
| 1791 | c.flags.SetOutput(c.flagErrorBuf) |
| 1792 | c.pflags = flag.NewFlagSet(c.DisplayName(), flag.ContinueOnError) |
| 1793 | c.pflags.SetOutput(c.flagErrorBuf) |
| 1794 | |
| 1795 | c.lflags = nil |
| 1796 | c.iflags = nil |
| 1797 | c.parentsPflags = nil |
| 1798 | } |
| 1799 | |
| 1800 | // HasFlags checks if the command contains any flags (local plus persistent from the entire structure). |
| 1801 | func (c *Command) HasFlags() bool { |
nothing calls this directly
no test coverage detected