mirror of
https://github.com/quitesimpleorg/hs9001.git
synced 2024-11-25 03:32:36 +01:00
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
This commit is contained in:
parent
c480519fca
commit
16752411e1
4
main.go
4
main.go
@ -234,7 +234,7 @@ func exists(path string) (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func printUsage() {
|
func printUsage() {
|
||||||
fmt.Fprintf(os.Stderr, "Usage: ./hs9001 <add/search/import>\n")
|
fmt.Fprintf(os.Stderr, "Usage: ./hs9001 <add/search/import/nolog>\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -266,6 +266,8 @@ func main() {
|
|||||||
migrateDatabase(conn, fetchDBVersion(conn))
|
migrateDatabase(conn, fetchDBVersion(conn))
|
||||||
|
|
||||||
switch cmd {
|
switch cmd {
|
||||||
|
case "nolog":
|
||||||
|
fmt.Printf("Run this command to disable logging for the current shell:\n\tunset PROMPT_COMMAND\n")
|
||||||
case "add":
|
case "add":
|
||||||
var ret int
|
var ret int
|
||||||
addCmd.IntVar(&ret, "ret", 0, "Return value of the command to add")
|
addCmd.IntVar(&ret, "ret", 0, "Return value of the command to add")
|
||||||
|
Loading…
Reference in New Issue
Block a user