diff options
author | Lee Jarvis <lee@jarvis.co> | 2011-04-03 13:01:25 +0100 |
---|---|---|
committer | Lee Jarvis <lee@jarvis.co> | 2011-04-03 13:01:25 +0100 |
commit | e3abbe869e5af5cd507aac90fe9b6061c965390d (patch) | |
tree | c31e064141d816b8743df1f1835443fad1d3d53b /README.md | |
parent | c92a74599b05e942c0711833a9bce31d02d43a27 (diff) | |
download | slop-e3abbe869e5af5cd507aac90fe9b6061c965390d.tar.gz |
attempt to fix whitespace
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -129,12 +129,12 @@ Callbacks If you'd like to trigger an event when an option is used, you can pass a block to your option. Here's how: - Slop.parse do - on :V, :version, 'Print the version' do - puts 'Version 1.0.0' - exit - end - end + Slop.parse do + on :V, :version, 'Print the version' do + puts 'Version 1.0.0' + exit + end + end Now when using the `--version` option on the command line, the trigger will be called and its contents executed. @@ -184,17 +184,17 @@ parse `-abcd` as the option `a` with the argument `bcd`, this can be disabled by passing the `:multiple_switches` option to a new Slop object. opts = Slop.new(:strict, :multiple_switches) do - on :a, 'First switch' - on :b, 'Second switch' - on :c, 'Third switch' - end + on :a, 'First switch' + on :b, 'Second switch' + on :c, 'Third switch' + end - opts.parse + opts.parse - # Using `-ac` - opts[:a] #=> true - opts[:b] #=> false - opts[:c] #=> true + # Using `-ac` + opts[:a] #=> true + opts[:b] #=> false + opts[:c] #=> true Ugh, Symbols ------------ |