Skip to content

Commit

Permalink
Avoid TODO
Browse files Browse the repository at this point in the history
We have Crystal v0.20.0 now ;)
  • Loading branch information
makenowjust authored and asterite committed Nov 24, 2016
1 parent 446dffa commit c954969
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/option_parser.cr
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,15 @@ class OptionParser
protected property flags : Array(String)
protected property handlers : Array(Handler)
protected property unknown_args
protected property! missing_option
protected property! invalid_option
protected property missing_option
protected property invalid_option

# Creates a new parser.
def initialize
@flags = [] of String
@handlers = [] of Handler
missing_option { |flag| raise MissingOption.new(flag) }
invalid_option { |flag| raise InvalidOption.new(flag) }
# TODO: switch to these and change property! to property above after 0.19.0
# @missing_option = ->(option : String) { raise MissingOption.new(option) }
# @invalid_option = ->(option : String) { raise InvalidOption.new(option) }
@missing_option = ->(option : String) { raise MissingOption.new(option) }
@invalid_option = ->(option : String) { raise InvalidOption.new(option) }
end

# Creates a new parser, with its configuration specified in the block.
Expand Down

0 comments on commit c954969

Please sign in to comment.