From dbf7c0a6a657d3063f93dd997fd23f89e805e4d5 Mon Sep 17 00:00:00 2001 From: luneko Date: Wed, 29 Dec 2021 01:56:47 +0100 Subject: [PATCH] added invalid option case to parser --- src/kotatsu.cr | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/kotatsu.cr b/src/kotatsu.cr index 49876c8..0ea1057 100644 --- a/src/kotatsu.cr +++ b/src/kotatsu.cr @@ -18,6 +18,12 @@ module Kotatsu puts VERSION exit end + + parser.invalid_option do |flag| + STDERR.puts "ERROR! Not a valid option: #{flag}" + STDERR.puts "Use -h or --help for all available options" + exit(1) + end end webserv = HTTP::Server.new do |context|