rename admin flag to password_admin

This commit is contained in:
Craig 2020-04-05 01:24:54 +00:00
parent 9c6fd9638e
commit 2bcd9e985b
2 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@
"envFile": "${workspaceFolder}/.env.development",
"output": "${workspaceFolder}/bin/debug/neko",
"cwd": "${workspaceFolder}/",
"args": ["serve", "-d", "--bind", ":3000", "--static", "../client/dist", "--password", "neko", "--admin", "admin"]
"args": ["serve", "-d", "--bind", ":3000", "--static", "../client/dist", "--password", "neko", "--password_admin", "admin"]
}
]
}

View File

@ -16,8 +16,8 @@ func (WebSocket) Init(cmd *cobra.Command) error {
return err
}
cmd.PersistentFlags().String("admin", "admin", "admin password for connecting to stream")
if err := viper.BindPFlag("admin", cmd.PersistentFlags().Lookup("admin")); err != nil {
cmd.PersistentFlags().String("password_admin", "admin", "admin password for connecting to stream")
if err := viper.BindPFlag("password_admin", cmd.PersistentFlags().Lookup("password_admin")); err != nil {
return err
}
@ -26,5 +26,5 @@ func (WebSocket) Init(cmd *cobra.Command) error {
func (s *WebSocket) Set() {
s.Password = viper.GetString("password")
s.AdminPassword = viper.GetString("admin")
s.AdminPassword = viper.GetString("password_admin")
}