mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-05 03:23:49 +08:00
internal/base: use relative path in flag -c default value
This commit is contained in:
parent
db64699f3c
commit
de44adbfa1
@ -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")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user