From d88df7e1bf7dc44c994757b0d77e207a769998fc Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sun, 4 Aug 2019 12:23:52 +0200 Subject: [PATCH] Add check for missing command arguments closes #1 Signed-off-by: Knut Ahlers --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index ff1897b..697d666 100644 --- a/main.go +++ b/main.go @@ -100,6 +100,10 @@ func main() { childenv[k] = v } + if len(rconfig.Args()) < 2 { + log.Fatal("No command specified") + } + c := exec.Command(rconfig.Args()[1], rconfig.Args()[2:]...) c.Env = envMapToList(childenv) c.Stdout = os.Stdout