summaryrefslogtreecommitdiff
path: root/vendor/github.com/spf13/cobra/user_guide.md
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-12-15 15:18:02 +0100
committerPaul Holzinger <pholzing@redhat.com>2021-12-16 15:28:39 +0100
commit03a3fc37fe82800113a1c9043448acb2afa539a6 (patch)
tree216aae69ad45e33c18bd5af8eb37d8a16dae4050 /vendor/github.com/spf13/cobra/user_guide.md
parentd1c91c128ea32dae3e9c56c657ea57dfed9f6ad4 (diff)
downloadpodman-03a3fc37fe82800113a1c9043448acb2afa539a6.tar.gz
podman-03a3fc37fe82800113a1c9043448acb2afa539a6.tar.bz2
podman-03a3fc37fe82800113a1c9043448acb2afa539a6.zip
bump cobra to 1.3.0
This contains some fixes for the shell completion files. [NO NEW TESTS NEEDED] Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'vendor/github.com/spf13/cobra/user_guide.md')
-rw-r--r--vendor/github.com/spf13/cobra/user_guide.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/vendor/github.com/spf13/cobra/user_guide.md b/vendor/github.com/spf13/cobra/user_guide.md
index 311abce28..e87cdf218 100644
--- a/vendor/github.com/spf13/cobra/user_guide.md
+++ b/vendor/github.com/spf13/cobra/user_guide.md
@@ -32,7 +32,7 @@ func main() {
Cobra provides its own program that will create your application and add any
commands you want. It's the easiest way to incorporate Cobra into your application.
-[Here](https://github.com/spf13/cobra/blob/master/cobra/README.md) you can find more information about it.
+For complete details on using the Cobra generator, please read [The Cobra Generator README](https://github.com/spf13/cobra/blob/master/cobra/README.md)
## Using the Cobra Library
@@ -281,7 +281,7 @@ func init() {
In this example, the persistent flag `author` is bound with `viper`.
**Note**: the variable `author` will not be set to the value from config,
-when the `--author` flag is not provided by user.
+when the `--author` flag is provided by user.
More in [viper documentation](https://github.com/spf13/viper#working-with-flags).
@@ -315,6 +315,7 @@ The following validators are built in:
- `ExactArgs(int)` - the command will report an error if there are not exactly N positional args.
- `ExactValidArgs(int)` - the command will report an error if there are not exactly N positional args OR if there are any positional args that are not in the `ValidArgs` field of `Command`
- `RangeArgs(min, max)` - the command will report an error if the number of args is not between the minimum and maximum number of expected args.
+- `MatchAll(pargs ...PositionalArgs)` - enables combining existing checks with arbitrary other checks (e.g. you want to check the ExactArgs length along with other qualities).
An example of setting the custom validator: