Compare commits
No commits in common. "main" and "v0.1.2" have entirely different histories.
|
@ -21,4 +21,4 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: shards install
|
run: shards install
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: crystal spec --error-trace
|
run: crystal spec
|
||||||
|
|
|
@ -67,7 +67,7 @@ which implements `from_arg` as a proxy for that type.
|
||||||
|
|
||||||
## Converters
|
## Converters
|
||||||
|
|
||||||
Converters are simply modules which have a `self.from_arg` method which takes
|
Converers are simply modules which have a `self.from_arg` method which takes
|
||||||
a value string, and returns the converted value. For Example:
|
a value string, and returns the converted value. For Example:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -67,8 +67,7 @@ module ArgParser
|
||||||
arg = %args.shift
|
arg = %args.shift
|
||||||
next unless key = parse_key(arg)
|
next unless key = parse_key(arg)
|
||||||
|
|
||||||
# TODO: Find a different way to handle this
|
value = %args.shift rescue nil
|
||||||
value = %args.shift rescue "true"
|
|
||||||
if value && parse_key(value)
|
if value && parse_key(value)
|
||||||
%args.unshift(value)
|
%args.unshift(value)
|
||||||
value = "true"
|
value = "true"
|
||||||
|
|
Loading…
Reference in New Issue