mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
now passing capture groups in as arguments to commands (prior to regular arguments). Now stripping spaces around arg_string
This commit is contained in:
parent
2f3ab643ab
commit
e3af5f3a1a
1 changed files with 6 additions and 3 deletions
|
@ -2,7 +2,7 @@ require 'forwardable'
|
|||
|
||||
class Pry
|
||||
class CommandProcessor
|
||||
SYSTEM_COMMAND_DELIMITER = "."
|
||||
SYSTEM_COMMAND_DELIMITER = "^"
|
||||
SYSTEM_COMMAND_REGEX = /^#{Regexp.escape(SYSTEM_COMMAND_DELIMITER)}(.*)/
|
||||
|
||||
extend Forwardable
|
||||
|
@ -131,7 +131,7 @@ class Pry
|
|||
|
||||
val.replace interpolate_string(val, target) if command.options[:interpolate]
|
||||
|
||||
arg_string = val[pos..-1]
|
||||
arg_string = val[pos..-1].strip
|
||||
|
||||
args = arg_string ? Shellwords.shellwords(arg_string) : []
|
||||
|
||||
|
@ -144,7 +144,7 @@ class Pry
|
|||
:captures => captures
|
||||
}
|
||||
|
||||
execute_command(target, command.name, options, *args)
|
||||
execute_command(target, command.name, options, *captures, *args)
|
||||
end
|
||||
|
||||
# Execute a Pry command.
|
||||
|
@ -160,6 +160,9 @@ class Pry
|
|||
context.opts = options
|
||||
context.target = target
|
||||
context.output = output
|
||||
context.captures = options[:captures]
|
||||
context.eval_string = options[:eval_string]
|
||||
context.arg_string = options[:arg_string]
|
||||
context.command_set = commands
|
||||
|
||||
context.command_processor = self
|
||||
|
|
Loading…
Reference in a new issue