summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorLee Jarvis <lee@jarvis.co>2011-04-12 22:08:26 +0100
committerLee Jarvis <lee@jarvis.co>2011-04-12 22:08:26 +0100
commitf8c705619de72257a61134fdbe6c724b5f7835e5 (patch)
treea576cca7194bc7e730ce43dab8e85215bdb6e59d /README.md
parentffddd1457e3f252923c46798e4fd20e1789877ee (diff)
downloadslop-f8c705619de72257a61134fdbe6c724b5f7835e5.tar.gz
move "Lists" header a little higher
Diffstat (limited to 'README.md')
-rw-r--r--README.md42
1 files changed, 21 insertions, 21 deletions
diff --git a/README.md b/README.md
index 1eaadf8..4787493 100644
--- a/README.md
+++ b/README.md
@@ -196,6 +196,27 @@ by passing the `:multiple_switches` option to a new Slop object.
opts[:b] #=> false
opts[:c] #=> true
+Lists
+-----
+
+You can of course also parse lists into options. Here's how:
+
+ opts = Slop.parse do
+ opt :people, true, :as => Array
+ end
+
+ # ARGV is `--people lee,john,bill`
+ opts[:people] #=> ['lee', 'john', 'bill']
+
+You can also change both the split delimiter and limit
+
+ opts = Slop.parse do
+ opt :people, true, :as => Array, :delimiter => ':', :limit => 2)
+ end
+
+ # ARGV is `--people lee:injekt:bob`
+ opts[:people] #=> ["lee", "injekt:bob"]
+
Ugh, Symbols
------------
@@ -238,27 +259,6 @@ You can also try other variations:
on :n, :name
on :name, true
-Lists
------
-
-You can of course also parse lists into options. Here's how:
-
- opts = Slop.parse do
- opt :people, true, :as => Array
- end
-
- # ARGV is `--people lee,john,bill`
- opts[:people] #=> ['lee', 'john', 'bill']
-
-You can also change both the split delimiter and limit
-
- opts = Slop.parse do
- opt :people, true, :as => Array, :delimiter => ':', :limit => 2)
- end
-
- # ARGV is `--people lee:injekt:bob`
- opts[:people] #=> ["lee", "injekt:bob"]
-
Strict Mode
-----------