Commit Graph

17 Commits

Author SHA1 Message Date
Marc Khouzam
10cf7be997
Check for group presence after full initialization (#1839)
Fixes #1831

By moving the check for help group existence to "ExecuteC()" we no
longer need groups to be added before AddCommand() is called.  This
provides more flexibility to developers and works better with the use
of "init()" for command creation.

Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
2022-10-24 11:11:57 -04:00
doniacld
4b9d00dfec
Replace deprecated ExactValidArgs with MatchAll in user_guide and shell_completions example (#1836) 2022-10-20 16:33:37 -04:00
aawsome
2169adb574
Add groups for commands in help (#1003)
* Add tests for grouping commands
* Adds Additional Command section in help

Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
Co-authored-by: Marc Khouzam <marc.khouzam@gmail.com>
2022-10-10 14:59:11 -06:00
Marc Khouzam
7e289f46f1
Adjustments to documentation (#1656)
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2022-09-11 17:48:42 -04:00
Unai Martinez-Corral
70e53f62be
Deprecate ExactValidArgs() and test combinations of args validators (#1643)
* deprecate ExactValidArgs in favour of MatchAll(OnlyValidArgs, ...)
* test combinations of args validators
* adjust docs
2022-09-10 09:33:34 -04:00
Unai Martinez-Corral
ea94a3db55
undefined or nil Args default to ArbitraryArgs (#1612) 2022-06-20 20:00:50 -06:00
Marc Khouzam
f464d6c82e
Add Active Help support (#1482) 2022-06-15 20:08:16 -04:00
Andreas Deininger
ffa8860dbe
Change links from http:// to https:// (#1695) 2022-05-17 14:28:13 -04:00
John Schnake
68b6b24f0c
Add ability to mark flags as required or exclusive as a group (#1654)
This change adds two features for dealing with flags:
 - requiring flags be provided as a group (or not at all)
 - requiring flags be mutually exclusive of each other

By utilizing the flag annotations we can mark which flag groups
a flag is a part of and during the parsing process we track which
ones we have seen or not.

A flag may be a part of multiple groups. The list of flags and the
type of group (required together or exclusive) make it a unique group.

Signed-off-by: John Schnake <jschnake@vmware.com>
2022-04-17 16:04:57 -05:00
Neville Bokdawalla
d622355c84
Changed branch name in the cobra generator link to 'main' (#1645) 2022-03-24 19:20:54 -04:00
John McBride
5b2b9e9f61
Removes viper dependency by removing cobra/ CLI tool (#1604)
The cobra bootstrapping CLI tool has moved to
https://github.com/spf13/cobra-cli

Signed-off-by: John McBride <jmcbride@vmware.com>
2022-03-10 08:19:35 -07:00
Nelz
45e521ea93
enable composing PositionalArgs (#896)
* enable composing PositionalArgs
* ExactValidArgs slated for removal
* tests and docs
* rename to MatchAll
2021-12-07 15:38:00 -07:00
Nickolas Kraus
3c84bf8704
Small correction in User Guide (#1009) 2021-11-15 13:26:11 -07:00
Steve Francia
cf87fc4e30 Updating generator documentation and links
Merging the updated documentation from the user_guide into the cobra/README.md.
Adding links as appropriate to both guides.
2021-11-03 15:36:51 -04:00
Steve Francia
c97b7ece0b Update documentation to reflect the module aware generator 2021-11-03 15:36:51 -04:00
umarcor
8eaca5f0f4 drop mitchellh/go-homedir (#853) 2021-06-30 14:08:43 -04:00
umarcor
ace6b14345 readme: split 'Getting Started' into 'user_guide.md' 2021-06-30 12:46:37 -04:00