diff options
author | Anthony Fok <foka@debian.org> | 2015-12-02 12:00:47 -0700 |
---|---|---|
committer | Anthony Fok <foka@debian.org> | 2015-12-03 00:36:38 -0700 |
commit | 00d04774f0d9789262557af6a6465d8b6271839d (patch) | |
tree | 6ac014c9a651962d6bd17d31aa69a720aed9c599 /commands/server.go | |
parent | c9526f6e3fdffe9e583e11d3513faa392576c305 (diff) |
Change most global flags into local ones
This is to ensure that only the relevant command-line flags
for a certain Hugo subcommand is shown to the end user,
reducing clutter and improving user experience.
Fixes #1624 - CLI UX: Flags shouldn't be global
Diffstat (limited to 'commands/server.go')
-rw-r--r-- | commands/server.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/commands/server.go b/commands/server.go index ec6b53149..adcf6dff2 100644 --- a/commands/server.go +++ b/commands/server.go @@ -81,6 +81,7 @@ func (f noDirFile) Readdir(count int) ([]os.FileInfo, error) { } func init() { + initCoreCommonFlags(serverCmd) serverCmd.Flags().IntVarP(&serverPort, "port", "p", 1313, "port on which the server will listen") serverCmd.Flags().StringVarP(&serverInterface, "bind", "", "127.0.0.1", "interface to which the server will bind") serverCmd.Flags().BoolVarP(&serverWatch, "watch", "w", true, "watch filesystem for changes and recreate as needed") @@ -94,7 +95,7 @@ func init() { } func server(cmd *cobra.Command, args []string) error { - if err := InitializeConfig(); err != nil { + if err := InitializeConfig(serverCmd); err != nil { return err } |