From 46f2c4b0cf615d89963c656e5a8f9681a8f677a0 Mon Sep 17 00:00:00 2001 From: Luka Vandervelden Date: Tue, 13 Aug 2019 13:23:57 +0200 Subject: [PATCH] --help added as a proper option. --- src/main.cr | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.cr b/src/main.cr index a5f4912..4209434 100644 --- a/src/main.cr +++ b/src/main.cr @@ -37,6 +37,11 @@ OptionParser.parse! do |parser| do_not_clean = true } + parser.on("-h", "--help", "Prints this help message.") { + puts parser + exit 0 + } + parser.invalid_option do |flag| STDERR.puts "ERROR: #{flag} is not a valid option." STDERR.puts parser