diff --git a/HISTORY.md b/HISTORY.md index 9b73a9d..21b37fd 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -8,3 +8,5 @@ ## 2.0.1 - [16/05/2022] - ➕ - Added colors to output +- ➕ - Added help +- ➕ - Added `--mkconfig` param to make new config file diff --git a/src/vk0nline.cr b/src/vk0nline.cr index bb01066..664a305 100644 --- a/src/vk0nline.cr +++ b/src/vk0nline.cr @@ -14,6 +14,19 @@ begin exit(0) end + parser.on "--mkconfig", "Make new empty config" do + new_config = {appID: nil, userIds: nil, accessToken: nil} + + File.open("config.json.new", "w") do |f| + f.puts new_config.to_json.to_s + end + + print "Config saved to " + print "config.json.new".colorize(:yellow).mode(:bold) + puts " file." + + exit(0) + end parser.on "-h", "--help", "Show help" do puts parser