added option to make config without running the server

This commit is contained in:
2021-12-30 14:45:50 +01:00
parent a98d5c316d
commit 8bd123a030

View File

@@ -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"