mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-23 22:15:54 +00:00
Merge b189df348270c16415f353ce6df99d933ee96aa1 into ed745a9acb0d1f2bf765e03d8ee4114d3032b73a
This commit is contained in:
commit
c71d2c14e1
@ -48,6 +48,11 @@ func parseConfig() (*configFlags, error) {
|
|||||||
parser := flags.NewParser(cfg, flags.PrintErrors|flags.HelpFlag)
|
parser := flags.NewParser(cfg, flags.PrintErrors|flags.HelpFlag)
|
||||||
_, err := parser.Parse()
|
_, err := parser.Parse()
|
||||||
|
|
||||||
|
// If special error ErrHelp catched by -h or --help
|
||||||
|
if ourErr, ok := err.(*flags.Error); ok && ourErr.Type == flags.ErrHelp {
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
// Show the version and exit if the version flag was specified.
|
// Show the version and exit if the version flag was specified.
|
||||||
if cfg.ShowVersion {
|
if cfg.ShowVersion {
|
||||||
appName := filepath.Base(os.Args[0])
|
appName := filepath.Base(os.Args[0])
|
||||||
@ -78,7 +83,8 @@ func parseConfig() (*configFlags, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if cfg.MiningAddr == "" {
|
if cfg.MiningAddr == "" {
|
||||||
return nil, errors.New("--miningaddr is required")
|
fmt.Fprintln(os.Stderr, errors.New("Error parsing command-line arguments: --miningaddr is required"))
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
initLog(defaultLogFile, defaultErrLogFile)
|
initLog(defaultLogFile, defaultErrLogFile)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user