init
This commit is contained in:
parent
976d3852fd
commit
34859d9a5b
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
**.log
|
||||
/ddgo
|
||||
logs
|
||||
ddgo
|
||||
go.sum
|
||||
dist
|
7
main.go
7
main.go
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user