From 8bd123a030deb924f11d67aaaa2558b57e325f69 Mon Sep 17 00:00:00 2001 From: luneko Date: Thu, 30 Dec 2021 14:45:50 +0100 Subject: [PATCH] added option to make config without running the server --- src/kotatsu.cr | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/kotatsu.cr b/src/kotatsu.cr index e5c8164..14bbe28 100644 --- a/src/kotatsu.cr +++ b/src/kotatsu.cr @@ -37,6 +37,16 @@ module Kotatsu exit end + parser.on "-mc", "--make-config", "Creates config file without running kotatsu" do + if File.exists?(CONFIG_FILE) == false + makeConfig(CONFIG_FILE, CONFIG_DIR) + exit + else + puts "Config already exists" + exit + end + end + parser.invalid_option do |flag| STDERR.puts "ERROR! Not a valid option: #{flag}" STDERR.puts "Use -h or --help for all available options"