From 2b50672ea90099444752240ef623221c0244276d Mon Sep 17 00:00:00 2001 From: luneko Date: Wed, 29 Dec 2021 01:36:30 +0100 Subject: [PATCH] added basic cli parser --- src/kotatsu.cr | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/kotatsu.cr b/src/kotatsu.cr index 524002f..260a221 100644 --- a/src/kotatsu.cr +++ b/src/kotatsu.cr @@ -1,6 +1,21 @@ # TODO: Write documentation for `Kotatsu` + +require "option_parser" + module Kotatsu VERSION = "0.1.0" - # TODO: Put your code here + OptionParser.parse do |parser| + parser.banner = "Kotatsu - Easy to configure server start page" + + parser.on "-h", "--help", "Show this help" do + puts parser + exit + end + + parser.on "-v", "--version", "Show kotatsu version" do + puts VERSION + exit + end + end end