Sha256: 41b569bea132b85835f423d7ecee0902ac23776ef2b9c65061208690f7be859e

Contents?: true

Size: 944 Bytes

Versions: 2

Compression:

Stored size: 944 Bytes

Contents

require "gli"
require "vindetta/version"

module Vindetta
  class CLI
    extend GLI::App

    program_desc "Vehicle Identification Number (VIN) CLI"
    version Vindetta::VERSION

    desc "Transliterates a VIN character"
    arg_name "character"
    command %i[transliterate t] do |c|
      c.action do |_global, _options, args|
        puts Vindetta::Transliterator.run(args.first)
      end
    end

    desc "Validates a VIN"
    command %i[validate v] do |c|
      c.action do |_global, _options, args|
        puts Vindetta::Validator.run(args.first)
      end
    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
      end
    end

    desc "Generates a random VIN"
    command %i[generate g] do |c|
      c.action do |_global, _options, _args|
        puts Vindetta::Generator.generate
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vindetta-0.10.0 lib/vindetta/cli.rb
vindetta-0.9.0 lib/vindetta/cli.rb