summaryrefslogtreecommitdiffstats
path: root/commands/genautocomplete.go
diff options
context:
space:
mode:
authorAnthony Fok <foka@debian.org>2015-12-02 02:20:55 -0700
committerAnthony Fok <foka@debian.org>2015-12-02 02:24:49 -0700
commit666ddd237791b56fd048992dca9a27d1af50a10e (patch)
treef841ee78bbe54a64b2c4eb9a77557aeaf78ab3ad /commands/genautocomplete.go
parent0d1d33d7f3a3867a0dc0a43ee02fd5cb84ec17fd (diff)
Enable dirname and filename completion for more flags
These flags are: * --source (-s), --cacheDir, --destination (-d) and --logFile * --completionfile and --dir.
Diffstat (limited to 'commands/genautocomplete.go')
-rw-r--r--commands/genautocomplete.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/commands/genautocomplete.go b/commands/genautocomplete.go
index 2a2fcdd91..b7f74fd89 100644
--- a/commands/genautocomplete.go
+++ b/commands/genautocomplete.go
@@ -48,4 +48,6 @@ func init() {
genautocompleteCmd.PersistentFlags().StringVarP(&autocompleteTarget, "completionfile", "", "/etc/bash_completion.d/hugo.sh", "Autocompletion file")
genautocompleteCmd.PersistentFlags().StringVarP(&autocompleteType, "type", "", "bash", "Autocompletion type (currently only bash supported)")
+ // For bash-completion
+ genautocompleteCmd.PersistentFlags().SetAnnotation("completionfile", cobra.BashCompFilenameExt, []string{})
}