feat!: force to use the bin dir as the data dir (close #2108)

- move default log path to `data/log/log.log`
- replace `--conf` with `--data`
This commit is contained in:
Noah Hsu
2022-11-01 19:14:49 +08:00
parent 141419056d
commit 1c212f6c30
4 changed files with 31 additions and 14 deletions

View File

@ -24,8 +24,9 @@ func Execute() {
}
func init() {
rootCmd.PersistentFlags().StringVar(&flags.Config, "conf", "data/config.json", "config file")
rootCmd.PersistentFlags().StringVar(&flags.DataDir, "data", "data", "config file")
rootCmd.PersistentFlags().BoolVar(&flags.Debug, "debug", false, "start with debug mode")
rootCmd.PersistentFlags().BoolVar(&flags.NoPrefix, "no-prefix", false, "disable env prefix")
rootCmd.PersistentFlags().BoolVar(&flags.Dev, "dev", false, "start with dev mode")
rootCmd.PersistentFlags().BoolVar(&flags.ForceBinDir, "force-bin-dir", false, "Force to use the directory where the binary file is located as data directory")
}