From d7f1e3f899f86633bc9d287b39eb56957ca143af Mon Sep 17 00:00:00 2001 From: Lee Jarvis Date: Wed, 17 Dec 2014 08:52:18 +0000 Subject: Add option types to README --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 50badb9..4666807 100644 --- a/README.md +++ b/README.md @@ -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 -------------- -- cgit v1.2.1