summaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
authorEyal Posener <[email protected]>2017-05-15 20:06:16 +0300
committerGitHub <[email protected]>2017-05-15 20:06:16 +0300
commit3db55cf7d9a927e1289f35f2bb2665cfdc2e0dc8 (patch)
treedae76c1575fe5c1172ec4e9fe9c3f9550e18b922 /readme.md
parent12dd12532c0fc5bac2fe75d3c031015456346a2e (diff)
parent096b79324eea451a70ffdf8dd3eb80097410a47f (diff)
Merge pull request #25 from posener/global
Add global flags for command
Diffstat (limited to 'readme.md')
-rw-r--r--readme.md13
1 files changed, 9 insertions, 4 deletions
diff --git a/readme.md b/readme.md
index 66e327a..274474d 100644
--- a/readme.md
+++ b/readme.md
@@ -85,15 +85,20 @@ func main() {
// define flags of the 'run' main command
Flags: complete.Flags{
-
- // a flag '-h' which does not expects anything after it
- "-h": complete.PredictNothing,
-
// a flag -o, which expects a file ending with .out after
// it, the tab completion will auto complete for files matching
// the given pattern.
"-o": complete.PredictFiles("*.out"),
},
+
+ // define gloabl flags of the 'run' main command
+ // those will show up also when a sub command was entered in the
+ // command line
+ Flags: complete.Flags{
+
+ // a flag '-h' which does not expects anything after it
+ "-h": complete.PredictNothing,
+ },
}
// run the command completion, as part of the main() function.