Skip to content

Commit

Permalink
bump up to 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mosop committed Jul 2, 2016
1 parent b6dbe56 commit 134564f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ result.args # => ["bar"]
result.unparsed_args # => ["baz"]
```

### Accessible Argument
### Named Argument

```crystal
class Model < Optarg::Model
Expand All @@ -139,8 +139,12 @@ end
result = Model.parse(%w(/path/to/src /path/to/build and more))
result.src_dir # => "/path/to/src"
result.args.src_dir # => "/path/to/src"
result.build_dir # => "/path/to/build"
result.args # => ["and", "more"]
result.args.build_dir # => "/path/to/build"
result.args # => ["/path/to/src", "/path/to/build", "and", "more"]
result.args.named # => {"src_dir" => "/path/to/src", "build_dir" => "/path/to/build"}
result.args.nameless # => ["and", "more"]
```

### Inheritance (Reusable Model)
Expand Down Expand Up @@ -180,23 +184,15 @@ Model.parse %w(--goodbye) # raises "Goodbye, world!"

```crystal
class Profile < Optarg::Model
string "--birth", required: true
def run
puts "birth date: #{options.birth}"
end
string "--birthday", required: true
end
Birthday.parse %w() # raises a Required exception.
Profile.parse %w() # raises a Required exception.
```

```crystal
class Compile < Optarg::Model
arg "source_file", required: true
def run
Compiler.compile options.source_file
end
end
Compile.parse %w() # raises a Required exception.
Expand Down Expand Up @@ -246,6 +242,8 @@ and see [Features](#features).

## Release Notes

* v0.2.0
* (Breaking Change) Model#args separates values into nameless and named.
* v0.1.14
* Required Arguments and Options
* Minimum Length of Array
Expand Down
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: optarg
version: 0.1.14
version: 0.2.0

authors:
- mosop
Expand Down
2 changes: 1 addition & 1 deletion spec/features/required_arguments_and_options_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Optarg::RequiredArgumentsAndOptionsFeature
end

class Profile < Optarg::Model
string "--birth", required: true
string "--birthday", required: true
end

it "Required Options" do
Expand Down
2 changes: 1 addition & 1 deletion src/optarg/version.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Optarg
VERSION = "0.1.14"
VERSION = "0.2.0"
end

0 comments on commit 134564f

Please sign in to comment.