--- commands/root.go.orig 1979-11-29 23:00:00 UTC +++ commands/root.go @@ -3,7 +3,6 @@ import ( import ( "fmt" "os" - "path/filepath" homedir "github.com/mitchellh/go-homedir" "github.com/spf13/cobra" @@ -25,7 +24,7 @@ func init() { func init() { cobra.OnInitialize(initConfig) - RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.go-cve-dictionary.yaml)") + RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "%%PREFIX%%/etc/go-cve-dictionary.yaml", "config file") RootCmd.PersistentFlags().Bool("log-to-file", false, "output log to file") _ = viper.BindPFlag("log-to-file", RootCmd.PersistentFlags().Lookup("log-to-file")) @@ -42,8 +41,7 @@ func init() { RootCmd.PersistentFlags().Bool("debug-sql", false, "SQL debug mode") _ = viper.BindPFlag("debug-sql", RootCmd.PersistentFlags().Lookup("debug-sql")) - pwd := os.Getenv("PWD") - RootCmd.PersistentFlags().String("dbpath", filepath.Join(pwd, "cve.sqlite3"), "/path/to/sqlite3 or SQL connection string") + RootCmd.PersistentFlags().String("dbpath", "/var/db/vuls/cve.sqlite3", "/path/to/sqlite3 or SQL connection string") _ = viper.BindPFlag("dbpath", RootCmd.PersistentFlags().Lookup("dbpath")) RootCmd.PersistentFlags().String("dbtype", "sqlite3", "Database type to store data in (sqlite3, mysql, postgres or redis supported)")