Fix configure hosts show emptying /etc/hosts and setpersist CLI variable in configure hosts

- Only open `/etc/hosts` when write intended
- Correct `SetPersist` CLI variable
This commit is contained in:
Niko Kivel
2021-01-28 11:41:12 +01:00
committed by GitHub
parent 4af728d6bf
commit d1f80662a6
2 changed files with 9 additions and 8 deletions

View File

@@ -16,7 +16,7 @@ var (
func init() {
baseCmd.PersistentFlags().BoolVarP(&SetShow, "show", "s", false, "Show configuration (don't update)")
baseCmd.PersistentFlags().BoolVar(&SetShow, "persist", false, "Persist the configuration and initialize the service")
baseCmd.PersistentFlags().BoolVar(&SetPersist, "persist", false, "Persist the configuration and initialize the service")
}
// GetRootCommand returns the root cobra.Command for the application.