1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-04 19:17:37 +08:00

internal/base: use relative path in flag -c default value

This commit is contained in:
wdvxdr 2022-11-03 20:55:01 +08:00
parent db64699f3c
commit de44adbfa1
No known key found for this signature in database
GPG Key ID: 703F8C071DE7A1B6

View File

@ -5,7 +5,6 @@ import (
"flag" "flag"
"fmt" "fmt"
"os" "os"
"path"
"time" "time"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
@ -54,9 +53,7 @@ var (
// Parse parse flags // Parse parse flags
func Parse() { func Parse() {
wd, _ := os.Getwd() flag.StringVar(&LittleC, "c", "config.yml", "configuration filename")
dc := path.Join(wd, "config.yml")
flag.StringVar(&LittleC, "c", dc, "configuration filename")
flag.BoolVar(&LittleD, "d", false, "running as a daemon") flag.BoolVar(&LittleD, "d", false, "running as a daemon")
flag.BoolVar(&LittleH, "h", false, "this Help") flag.BoolVar(&LittleH, "h", false, "this Help")
flag.StringVar(&LittleWD, "w", "", "cover the working directory") flag.StringVar(&LittleWD, "w", "", "cover the working directory")