From 854d86ccbe65e61d818b63d13903b60ebae90664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 3 Oct 2016 19:09:41 +0200 Subject: [PATCH] Ensure that "command not found" error is printed on stderr Otherwise, for example, a `browse` command would have failed silently if the program for the browser couldn't be found. Ref. f507de0596d2f0d7cc028a4f3185ef139d492e26 Fixes #1289 --- cmd/cmd.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/cmd.go b/cmd/cmd.go index 27e7987b..05aa1c04 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -77,7 +77,10 @@ func (cmd *Cmd) Exec() error { binary, err := exec.LookPath(cmd.Name) if err != nil { - return fmt.Errorf("command not found: %s", cmd.Name) + return &exec.Error{ + Name: cmd.Name, + Err: fmt.Errorf("command not found"), + } } args := []string{binary}