master
grumbulon 9 months ago
parent 4fbafffd8d
commit 49e8ada15c

@ -7,7 +7,6 @@ import (
)
type Options struct {
Init bool
Path string
}
@ -19,14 +18,13 @@ func ParseCLI(args []string, version string) (*Options, error) {
Usage: mmd
mmd -i -- this will create your credentials
mmd -p <config.yaml> -- store instance and API token in config.yaml
Options:`)
flagSet.PrintDefaults()
}
var (
Init = flagSet.Bool("init", false, "inits new auth", flag.OptShorthand('i'))
Path = flagSet.String("path", "", "config path", flag.OptShorthand('p'))
)
@ -39,7 +37,6 @@ func ParseCLI(args []string, version string) (*Options, error) {
}
opts := Options{
Init: *Init,
Path: *Path,
}

@ -10,11 +10,10 @@ import (
)
func main() {
if opts, err := run(os.Args); err != nil {
if _, err := run(os.Args); err != nil {
if errors.Is(err, ErrNotError) || strings.Contains(err.Error(), "help requested") {
os.Exit(0)
} else {
opts.Init = false
os.Exit(1)
}
}

Loading…
Cancel
Save