This commit is contained in:
ehlxr 2019-11-15 10:23:47 +08:00
parent 976d3852fd
commit 34859d9a5b
2 changed files with 7 additions and 4 deletions

4
.gitignore vendored
View File

@ -1,4 +1,4 @@
**.log
/ddgo
logs
ddgo
go.sum
dist

View File

@ -82,7 +82,7 @@ func initLog() {
err = log.NewFile(log.FileConfig{
Level: log.LevelInfo,
Filename: "ddgo.log",
Filename: "./logs/ddgo.log",
FileRotationConfig: log.FileRotationConfig{
Rotate: true,
Daily: true,
@ -95,6 +95,10 @@ func initLog() {
func parseArg() {
parser := flags.NewParser(&opts, flags.HelpFlag|flags.PassDoubleDash)
if AppName != "" {
parser.Name = AppName
}
if _, err := parser.Parse(); err != nil {
if opts.Version {
printVersion()
@ -108,7 +112,6 @@ func parseArg() {
_, _ = fmt.Fprintln(os.Stderr, err)
parser.Name = AppName
parser.WriteHelp(os.Stderr)
os.Exit(1)