diff options
Diffstat (limited to 'commands')
-rw-r--r-- | commands/commands_test.go | 1 | ||||
-rw-r--r-- | commands/config.go (renamed from commands/list_config.go) | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/commands/commands_test.go b/commands/commands_test.go index 4eab9b99f..7e590bea0 100644 --- a/commands/commands_test.go +++ b/commands/commands_test.go @@ -51,6 +51,7 @@ func TestCommands(t *testing.T) { // no args = hugo build {nil, []string{sourceFlag}, ""}, {nil, []string{sourceFlag, "--renderToMemory"}, ""}, + {[]string{"config"}, []string{sourceFlag}, ""}, {[]string{"benchmark"}, []string{sourceFlag, "-n=1"}, ""}, {[]string{"convert", "toTOML"}, []string{sourceFlag, "-o=" + filepath.Join(dirOut, "toml")}, ""}, {[]string{"convert", "toYAML"}, []string{sourceFlag, "-o=" + filepath.Join(dirOut, "yaml")}, ""}, diff --git a/commands/list_config.go b/commands/config.go index 32b739d8a..951b57540 100644 --- a/commands/list_config.go +++ b/commands/config.go @@ -25,6 +25,7 @@ import ( var _ cmder = (*configCmd)(nil) type configCmd struct { + hugoBuilderCommon *baseCmd } @@ -37,11 +38,13 @@ func newConfigCmd() *configCmd { RunE: cc.printConfig, }) + cc.cmd.Flags().StringVarP(&cc.source, "source", "s", "", "filesystem path to read files relative from") + return cc } func (c *configCmd) printConfig(cmd *cobra.Command, args []string) error { - cfg, err := initializeConfig(false, nil, c, nil) + cfg, err := initializeConfig(false, &c.hugoBuilderCommon, c, nil) if err != nil { return err |