summaryrefslogtreecommitdiffstats
path: root/commands/new.go
diff options
context:
space:
mode:
authorAnthony Fok <foka@debian.org>2015-12-15 23:41:10 -0700
committerAnthony Fok <foka@debian.org>2015-12-16 00:00:05 -0700
commitc1e134f1c28800e5c12126c731cbb5c257aa0c6a (patch)
tree9a33631a1f12fd3fd85d3e19a1d2c00cf6ee124d /commands/new.go
parent41a3af1a29deb979d24e12d56dd3ef52073d580d (diff)
Add `--source` flag back to `hugo new` command
v0.15 had it, but I removed it inadvertently for 0.16-DEV in commit 00d04774 in PR #1652. Also add directory bash-completion for `--source` for `hugo convert`, `hugo list` and `hugo new`. See #1624, #1589
Diffstat (limited to 'commands/new.go')
-rw-r--r--commands/new.go2
1 files changed, 2 insertions, 0 deletions
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)
}