added mkconfig

This commit is contained in:
Alexander Popov 2022-05-16 22:58:59 +03:00
parent 5511a355d4
commit d31f591f52
Signed by: iiiypuk
GPG Key ID: 3F76816AEE08F908
2 changed files with 15 additions and 0 deletions

View File

@ -8,3 +8,5 @@
## 2.0.1 - [16/05/2022] ## 2.0.1 - [16/05/2022]
- - Added colors to output - - Added colors to output
- - Added help
- - Added `--mkconfig` param to make new config file

View File

@ -14,6 +14,19 @@ begin
exit(0) exit(0)
end 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 parser.on "-h", "--help", "Show help" do
puts parser puts parser