Enable dirname and filename completion for more flags

These flags are:

 * --source (-s), --cacheDir, --destination (-d) and --logFile
 * --completionfile and --dir.
This commit is contained in:
Anthony Fok
2015-12-02 02:20:55 -07:00
parent 0d1d33d7f3
commit 666ddd2377
4 changed files with 13 additions and 1 deletions

View File

@@ -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{})
}