MarkFlagRequired instructs the various shell completion implementations to prioritize the named flag when performing completion, and causes your command to report an error if invoked without the flag.
(name string)
| 22 | // prioritize the named flag when performing completion, |
| 23 | // and causes your command to report an error if invoked without the flag. |
| 24 | func (c *Command) MarkFlagRequired(name string) error { |
| 25 | return MarkFlagRequired(c.Flags(), name) |
| 26 | } |
| 27 | |
| 28 | // MarkPersistentFlagRequired instructs the various shell completion implementations to |
| 29 | // prioritize the named persistent flag when performing completion, |