From 16752411e10823d152bdb2b323b409074f356c6a Mon Sep 17 00:00:00 2001 From: lawl Date: Sat, 5 Jun 2021 14:35:42 +0200 Subject: [PATCH] Add 'nolog' subcommand The nolog subcommand instructs the user on how to disable logging for the current shell. This is not (easily) doable automatically since we can't affect a parent's environment without insane hacks. Fixes #4 --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 8248977..d9eb13a 100644 --- a/main.go +++ b/main.go @@ -234,7 +234,7 @@ func exists(path string) (bool, error) { } func printUsage() { - fmt.Fprintf(os.Stderr, "Usage: ./hs9001 \n") + fmt.Fprintf(os.Stderr, "Usage: ./hs9001 \n") } func main() { @@ -266,6 +266,8 @@ func main() { migrateDatabase(conn, fetchDBVersion(conn)) switch cmd { + case "nolog": + fmt.Printf("Run this command to disable logging for the current shell:\n\tunset PROMPT_COMMAND\n") case "add": var ret int addCmd.IntVar(&ret, "ret", 0, "Return value of the command to add")