From dd13048b3b8cf710f44424ce9fedc2b56c31fde3 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Mon, 13 Mar 2023 19:46:39 -0700 Subject: 51572: fix "shift" error when running standalone --- Functions/Misc/run-help | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Functions') diff --git a/Functions/Misc/run-help b/Functions/Misc/run-help index d52c1b032..14d09bd65 100644 --- a/Functions/Misc/run-help +++ b/Functions/Misc/run-help @@ -98,13 +98,13 @@ do if whence "run-help-$1:t" >/dev/null then local cmd_args - builtin getln cmd_args + builtin getln cmd_args && builtin print -z "$cmd_args" - cmd_args=( ${(z)cmd_args} ) + cmd_args=( ${(z)${cmd_args:-"$*"}} ) # Discard the command itself & everything before it. shift $cmd_args[(i)${run_help_orig_cmd:-$1}] cmd_args || - return + continue # Discard options, parameter assignments & paths. cmd_args=( ${cmd_args[@]:#([-+]*|*=*|*/*|\~*)} ) -- cgit 1.4.1