lib/vindetta/cli.rb in vindetta-0.10.0 vs lib/vindetta/cli.rb in vindetta-0.11.0
- old
+ new
@@ -1,7 +1,8 @@
require "gli"
require "vindetta/version"
+require "pp"
module Vindetta
class CLI
extend GLI::App
@@ -24,10 +25,12 @@
end
desc "Decodes a VIN"
command %i[decode d] do |c|
c.action do |_global, _options, _args|
- puts Vindetta::Decoder.decode_vin(_args.first).to_json
+ vin = STDIN.gets.chomp || _args.first
+
+ puts Vindetta::Decoder.decode_vin(vin).to_json
end
end
desc "Generates a random VIN"
command %i[generate g] do |c|