Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
Chris Watson | 89516cc699 | |
Mathieu Ablasou | 13aa2b3bae | |
Chris Watson | e6f7413674 | |
Chris Watson | ef7a9f76dc |
|
@ -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
|
run: crystal spec --error-trace
|
||||||
|
|
|
@ -67,7 +67,7 @@ which implements `from_arg` as a proxy for that type.
|
||||||
|
|
||||||
## Converters
|
## Converters
|
||||||
|
|
||||||
Converers are simply modules which have a `self.from_arg` method which takes
|
Converters 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,7 +67,8 @@ module ArgParser
|
||||||
arg = %args.shift
|
arg = %args.shift
|
||||||
next unless key = parse_key(arg)
|
next unless key = parse_key(arg)
|
||||||
|
|
||||||
value = %args.shift rescue nil
|
# TODO: Find a different way to handle this
|
||||||
|
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