From 6619bd86cec6d3dce640e2a8241559c82e2db694 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sun, 30 Dec 2018 13:34:45 +0100 Subject: [PATCH] Do not pass arguments if empty --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index dafae4a..a44aa6b 100644 --- a/main.go +++ b/main.go @@ -41,7 +41,11 @@ func interactiveShell() { func showQueue() { var entries []parser.QEntry var err error - entries, err = readFromCmd(exec.Command(settings["mailqCommand"], settings["mailqCommandArgs"])) + if settings["mailqCommandArgs"] == "" { + entries, err = readFromCmd(exec.Command(settings["mailqCommand"])) + } else { + entries, err = readFromCmd(exec.Command(settings["mailqCommand"], settings["mailqCommandArgs"])) + } if err != nil { fmt.Printf("Error reading: %s\n", err.Error()) os.Exit(1)