feat(cli): random option (#8)

* add the --random flag

* chore: use keys instead of first item

it matches the spec

---------

Co-authored-by: Evangelos Paterakis <evan@geopjr.dev>
This commit is contained in:
miampf 2023-06-28 01:49:15 +00:00 committed by Evangelos Paterakis
parent fc3fc759c3
commit 4d72899b2d
No known key found for this signature in database
GPG key ID: FE5185F095BFC8C9

View file

@ -60,6 +60,10 @@ module Blahaj
@config.color = down_flag
end
parser.on("-r", "--random", "Use a random color scheme") do
@config.color = COLORS.keys.sample
end
parser.on("--flags", "List all available flags") do
puts "Available flags/colors:\n".colorize(:light_blue)
puts COLORS.keys.sort.map { |x|