Skip to content

Commit

Permalink
Add fixes for Crystal 0.25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
j8r committed Jun 15, 2018
1 parent f7e26f4 commit 19fbac3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion shard.yml
@@ -1,5 +1,5 @@
name: clicr
version: 0.3.2
version: 0.3.3

authors:
- Julien Reichardt <mi@jrei.ch>
Expand Down
8 changes: 5 additions & 3 deletions src/clicr.cr
Expand Up @@ -15,7 +15,7 @@ module Clicr
commands = NamedTupleLiteral,
arguments = ArrayLiteral,
options = NamedTupleLiteral,
variables = NamedTupleLiteral,
variables = NamedTupleLiteral
)
# {{name}}
# Needed to have variables "namespaced"
Expand Down Expand Up @@ -142,7 +142,8 @@ module Clicr

# Help
when "", "--{{help_option.id}}", "-{{help_option.chars.first.id}}"{% if action == nil %}, ARGV.last{% end %}
raise Exception.new(<<-HELP
raise Exception.new(
<<-HELP
{{usage_name.id}}: {{name.id}}\
{% if arguments.is_a? ArrayLiteral %} {{arguments.join(' ').id.upcase}}{% end %}\
{% if commands.is_a? NamedTupleLiteral %} {{commands_name.id.upcase}}{% end %}\
Expand Down Expand Up @@ -173,7 +174,8 @@ module Clicr
{% end %}
{% end %}
'{{name.id}} --{{help_option.id}}' {{help.id}}
HELP, Exception.new "help")
HELP
, Exception.new "help")
# Generate options match
{% if options.is_a? NamedTupleLiteral %}{% for key, value in options %}
when "--{{key}}" \
Expand Down

0 comments on commit 19fbac3

Please sign in to comment.