Add --init-completion flag to print completion code

This flag takes as input 'bash' or 'zsh' and generates the completion
code for the specified shell.
This commit is contained in:
Antoine Eiche
2016-07-21 21:01:59 +02:00
parent ee2e8aa5b2
commit 7640bef0eb
3 changed files with 50 additions and 0 deletions

View File

@@ -27,6 +27,12 @@ var BashCompletionFlag = &BoolFlag{
Hidden: true,
}
// InitCompletionFlag generates completion code
var InitCompletionFlag = &StringFlag{
Name: "init-completion",
Usage: "generate completion code. Value must be 'bash' or 'zsh'",
}
// VersionFlag prints the version for the application
var VersionFlag = &BoolFlag{
Name: "version",