diff options
author | Lee Jarvis <ljjarvis@gmail.com> | 2014-12-17 08:52:18 +0000 |
---|---|---|
committer | Lee Jarvis <ljjarvis@gmail.com> | 2014-12-17 08:52:18 +0000 |
commit | d7f1e3f899f86633bc9d287b39eb56957ca143af (patch) | |
tree | 71a009076afa7fc801a017eff3843b70081b8db7 | |
parent | cc8784b0f57194ee17eaebafbe2a1b4cc2bfe816 (diff) | |
download | slop-d7f1e3f899f86633bc9d287b39eb56957ca143af.tar.gz |
Add option types to README
-rw-r--r-- | README.md | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -37,6 +37,23 @@ opts.quiet? #=> false opts.to_hash #=> { host: "192.168.0.1", port: 80, verbose: true, quiet: false } ``` +Option types +------------ + +Built in Option types are as follows: + +```ruby +o.string #=> Slop::StringOption, expects an argument +o.bool #=> Slop::BoolOption, no argument, aliased to BooleanOption +o.integer #=> Slop::IntegerOption, expects an argument, aliased to IntOption +o.array #=> Slop::ArrayOption, expects an argument +o.null #=> Slop::NullOption, no argument and ignored from `to_hash` +o.on #=> alias for o.null +``` + +You can see all built in types in `slop/types.rb`. Suggestions or pull requests +for more types are welcome. + Advanced Usage -------------- |