From ad3568d78568195bd653b67aa4e2084add6adf2a Mon Sep 17 00:00:00 2001 From: Sekulum Forka Date: Thu, 13 May 2021 13:36:38 +0200 Subject: [PATCH] Builtins: setenv: Raises a ShellCommandError incase of lack of arguments --- src/fsh.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fsh.nim b/src/fsh.nim index cf3297c..e1c22fe 100644 --- a/src/fsh.nim +++ b/src/fsh.nim @@ -226,7 +226,9 @@ proc runBuiltin(builtin: string, args: openArray[string]): string = return "" of "setenv": if args.len < 2: - raise newException(Exception, "setenv: Not enough arguments provided") + var e = newException(ShellCommandError, "Setenv: not enough arguments provided") + e.command="setenv" + raise e try: envVariables[args[0]] = args[1..^1].join(":") putEnv(args[0], args[1..^1].join(":"))