Skip to content

Commit e7d15a0

Browse files
committed
fix(helper): use non-deprecated pre_run hook method
1 parent 2703ee4 commit e7d15a0

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/cling/helper.cr

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,21 @@ module Cling
1010
add_option 'v', "version", description: "sends the app version"
1111
end
1212

13-
def pre_run(arguments : Cling::Arguments, options : Cling::Options) : Bool
13+
def pre_run(arguments : Cling::Arguments, options : Cling::Options) : Nil
1414
if arguments.empty? && options.empty?
1515
Formatter.new.generate(self).to_s(stdout)
16-
return false
16+
exit_program 0
1717
end
1818

1919
case options
2020
when .has? "help"
2121
Formatter.new.generate(self).to_s(stdout)
2222

23-
false
23+
exit_program 0
2424
when .has? "version"
2525
puts @version
2626

27-
false
28-
else
29-
true
27+
exit_program 0
3028
end
3129
end
3230
end

0 commit comments

Comments
 (0)