Add explicit exit command. Close #11

This commit is contained in:
Kleissner
2021-12-11 19:55:22 +01:00
parent a34509c0bf
commit d9c4b8a94c

View File

@@ -13,6 +13,7 @@ import (
"fmt"
"io"
"net"
"os"
"sort"
"strconv"
"strings"
@@ -46,6 +47,7 @@ func showHelp(output io.Writer) {
"dht store Store data into DHT\n"+
"get block Get block from remote peer\n"+
"log error Set error log output\n"+
"exit Exit\n"+
"\n")
}
@@ -440,6 +442,9 @@ func userCommands(input io.Reader, output io.Writer, terminateSignal chan struct
go blockTransfer(peer, uint64(blockNumber))
case "exit":
core.Filters.LogError("userCommands", "graceful exit via user terminal command\n")
os.Exit(core.ExitGraceful)
}
}
}