mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
Fixed duplicated kaspaminer help output
This commit is contained in:
parent
5a3b8a0066
commit
b189df3482
@ -48,6 +48,11 @@ func parseConfig() (*configFlags, error) {
|
||||
parser := flags.NewParser(cfg, flags.PrintErrors|flags.HelpFlag)
|
||||
_, 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.
|
||||
if cfg.ShowVersion {
|
||||
appName := filepath.Base(os.Args[0])
|
||||
@ -78,7 +83,8 @@ func parseConfig() (*configFlags, error) {
|
||||
}
|
||||
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user