Do not pass arguments if empty

This commit is contained in:
Jan Philipp Timme 2018-12-30 13:34:45 +01:00
parent 1c8a2a0924
commit 6619bd86ce
1 changed files with 5 additions and 1 deletions

View File

@ -41,7 +41,11 @@ func interactiveShell() {
func showQueue() { func showQueue() {
var entries []parser.QEntry var entries []parser.QEntry
var err error 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 { if err != nil {
fmt.Printf("Error reading: %s\n", err.Error()) fmt.Printf("Error reading: %s\n", err.Error())
os.Exit(1) os.Exit(1)