diff --git a/commands/convert.go b/commands/convert.go index 9882b0069..4fad9070e 100644 --- a/commands/convert.go +++ b/commands/convert.go @@ -76,6 +76,7 @@ func init() { convertCmd.PersistentFlags().StringVarP(&outputDir, "output", "o", "", "filesystem path to write files to") convertCmd.PersistentFlags().StringVarP(&Source, "source", "s", "", "filesystem path to read files relative from") convertCmd.PersistentFlags().BoolVar(&unsafe, "unsafe", false, "enable less safe operations, please backup first") + convertCmd.PersistentFlags().SetAnnotation("source", cobra.BashCompSubdirsInDir, []string{}) } func convertContents(mark rune) (err error) { diff --git a/commands/list.go b/commands/list.go index 207eb9f11..4246b1aa4 100644 --- a/commands/list.go +++ b/commands/list.go @@ -26,6 +26,7 @@ func init() { listCmd.AddCommand(listDraftsCmd) listCmd.AddCommand(listFutureCmd) listCmd.PersistentFlags().StringVarP(&Source, "source", "s", "", "filesystem path to read files relative from") + listCmd.PersistentFlags().SetAnnotation("source", cobra.BashCompSubdirsInDir, []string{}) } var listCmd = &cobra.Command{ diff --git a/commands/new.go b/commands/new.go index d465e83ff..0eb87dac3 100644 --- a/commands/new.go +++ b/commands/new.go @@ -41,6 +41,8 @@ func init() { newSiteCmd.Flags().Bool("force", false, "Init inside non-empty directory") newCmd.Flags().StringVarP(&configFormat, "format", "f", "toml", "frontmatter format") newCmd.Flags().StringVarP(&contentType, "kind", "k", "", "Content type to create") + newCmd.PersistentFlags().StringVarP(&Source, "source", "s", "", "filesystem path to read files relative from") + newCmd.PersistentFlags().SetAnnotation("source", cobra.BashCompSubdirsInDir, []string{}) newCmd.AddCommand(newSiteCmd) newCmd.AddCommand(newThemeCmd) }