mirror of
https://github.com/muraenateam/muraena.git
synced 2026-07-23 10:07:55 +00:00
28 lines
588 B
Go
28 lines
588 B
Go
package core
|
|
|
|
import (
|
|
"errors"
|
|
"flag"
|
|
)
|
|
|
|
type Options struct {
|
|
Debug *bool
|
|
Version *bool
|
|
NoColors *bool
|
|
ConfigFilePath *string
|
|
}
|
|
|
|
var ErrInterrupt = errors.New("^C")
|
|
|
|
func ParseOptions() (Options, error) {
|
|
o := Options{
|
|
ConfigFilePath: flag.String("config", "", "JSON configuration file path"),
|
|
Debug: flag.Bool("debug", false, "Print debug messages."),
|
|
Version: flag.Bool("version", false, "Print current version."),
|
|
NoColors: flag.Bool("no-colors", false, "Disable output color effects."),
|
|
}
|
|
|
|
flag.Parse()
|
|
|
|
return o, nil
|
|
}
|