From 273d5004bec3138b6ca7fd17f4f12e3c2f2abf2f Mon Sep 17 00:00:00 2001 From: knu Date: Sun, 13 Dec 2015 05:19:03 +0000 Subject: * lib/shellwords.rb (Shellwords#shellsplit): Document that this method does not treat shell metacharacters as such. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/shellwords.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/shellwords.rb') diff --git a/lib/shellwords.rb b/lib/shellwords.rb index 66092c8999..0030f0784f 100644 --- a/lib/shellwords.rb +++ b/lib/shellwords.rb @@ -64,6 +64,13 @@ module Shellwords # argv = Shellwords.split('here are "two words"') # argv #=> ["here", "are", "two words"] # + # Note, however, that this is not a command line parser. Shell + # metacharacters except for the single and double quotes and + # backslash are not treated as such. + # + # argv = Shellwords.split('ruby my_prog.rb | less') + # argv #=> ["ruby", "my_prog.rb", "|", "less"] + # # String#shellsplit is a shortcut for this function. # # argv = 'here are "two words"'.shellsplit -- cgit v1.2.3