Fix params not being passed to scripts

This commit is contained in:
sjanusz 2022-01-19 17:18:47 +00:00
parent ad9517b81d
commit d854751f82
No known key found for this signature in database
GPG Key ID: 62086A0F9E2BB842
1 changed files with 6 additions and 0 deletions

View File

@ -1351,6 +1351,7 @@ class Core
response_timeout = 15
search_term = nil
session_name = nil
has_script_arguments = false
# any arguments that don't correspond to an option or option arg will
# be put in here
@ -1362,6 +1363,8 @@ class Core
else
# Parse the command options
@@sessions_opts.parse(args) do |opt, idx, val|
next if has_script_arguments
case opt
when "-q", "--quiet"
quiet = true
@ -1398,6 +1401,9 @@ class Core
unless script
method = 'script'
script = val
# Assume any parameter after the script name is a flag/argument we want to pass to the script itself.
extra += args[(idx + 1)..-1]
has_script_arguments = true
end
# Upload and exec to the specific command session
when "-u", "--upgrade"