diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-04-10 09:19:26 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-04-11 09:50:19 +0200 |
commit | 4d32f2fa8969f368b088dc9bcedb45f2c986cb27 (patch) | |
tree | a091c49f6011605f08b92b9dbdb2d2acdd87f9ce /commands/helpers.go | |
parent | 018602c46db8d729af2871bd5f4c1e7480420f09 (diff) |
commands: Make the hugo command non-global
See #4598
Diffstat (limited to 'commands/helpers.go')
-rw-r--r-- | commands/helpers.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/commands/helpers.go b/commands/helpers.go index 78e549d22..1386e425f 100644 --- a/commands/helpers.go +++ b/commands/helpers.go @@ -15,6 +15,14 @@ // used by Hugo. Commands and flags are implemented using Cobra. package commands +import ( + "fmt" + "regexp" + + "github.com/gohugoio/hugo/config" + "github.com/spf13/cobra" +) + const ( ansiEsc = "\u001B" clearLine = "\r\033[K" @@ -22,6 +30,15 @@ const ( showCursor = ansiEsc + "[?25h" ) +type flagsToConfigHandler interface { + flagsToConfig(cfg config.Provider) +} + +type cmder interface { + flagsToConfigHandler + getCommand() *cobra.Command +} + // commandError is an error used to signal different error situations in command handling. type commandError struct { s string |