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

@@ -60,4 +60,7 @@ for rendering in Hugo.`,
func init() {
gendocCmd.PersistentFlags().StringVar(&gendocdir, "dir", "/tmp/hugodoc/", "the directory to write the doc.")
// For bash-completion
gendocCmd.PersistentFlags().SetAnnotation("dir", cobra.BashCompSubdirsInDir, []string{})
}