From 6329309d464f059bdbff477d25da056f64b8a9ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Mon, 20 Jan 2025 15:41:43 +0100 Subject: [PATCH] Fix handle global `--help` flag --- src/cli.cr | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cli.cr b/src/cli.cr index beb8ad243..36036ebcb 100644 --- a/src/cli.cr +++ b/src/cli.cr @@ -57,6 +57,10 @@ module Shards opts.on("-q", "--quiet", "Decrease the log verbosity, printing only warnings and errors.") { self.set_warning_log_level } opts.on("-h", "--help", "Print usage synopsis.") { display_help = true } + if cli_options[0]? == "--help" + display_help_and_exit(opts) + end + opts.unknown_args do |args, options| case args[0]? || DEFAULT_COMMAND when "build"