summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-13 05:19:03 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-13 05:19:03 +0000
commit273d5004bec3138b6ca7fd17f4f12e3c2f2abf2f (patch)
treeb9b3c7d4f3759ea7efcce099355c8cd09a3a63a0 /lib
parentc53479ae8afa9c32966a38f6b754f8e31f130b96 (diff)
* 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
Diffstat (limited to 'lib')
-rw-r--r--lib/shellwords.rb7
1 files changed, 7 insertions, 0 deletions
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