diff options
author | Lee Jarvis <ljjarvis@gmail.com> | 2014-12-19 16:08:04 +0000 |
---|---|---|
committer | Lee Jarvis <ljjarvis@gmail.com> | 2014-12-19 16:17:19 +0000 |
commit | 7cee65ee47c365799bfe0f03217036c1dc0787b2 (patch) | |
tree | 7009bb91911333393d24c4dc42838a0ca6061069 /README.md | |
parent | 6c509658f8052f1ef9dba8ed5db2207e6375665e (diff) | |
download | slop-7cee65ee47c365799bfe0f03217036c1dc0787b2.tar.gz |
Add result/parser `arguments` method
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -81,6 +81,22 @@ result.to_hash #=> { hostname: "192.168.0.1", port: 80, puts opts # prints out help ``` +Arguments +--------- + +It's common to want to retrieve an array of arguments that were not processed +by the parser (i.e options or consumed arguments). You can do that with the +`Result#arguments` method: + +```ruby +args = %w(connect --host google.com GET) +opts = Slop.parse args do |o| + o.string '--host' +end + +p opts.arguments #=> ["connect", "GET"] # also aliased to `args` +``` + Arrays ------ |