mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-02 03:34:39 -06:00
Exit with code 2 when an invalid command is provided
This commit is contained in:
@@ -2188,6 +2188,12 @@ func main() {
|
||||
app.Usage = "A new generation cloud backup tool based on lock-free deduplication"
|
||||
app.Version = "2.7.2" + " (" + GitCommit + ")"
|
||||
|
||||
// Exit with code 2 if an invalid command is provided
|
||||
app.CommandNotFound = func(context *cli.Context, command string) {
|
||||
fmt.Fprintf(context.App.Writer, "Invalid command: %s\n", command)
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
// If the program is interrupted, call the RunAtError function.
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt)
|
||||
|
||||
Reference in New Issue
Block a user