Sha256: 99fcfb9099833cbcf31d64ebb64649b076c3d867963957f8ffeaf988da846635

Contents?: true

Size: 700 Bytes

Versions: 1

Compression:

Stored size: 700 Bytes

Contents

require 'gli'

module Vindetta
  class CLI
    extend GLI::App

    program_desc 'Vehicle Identification Number (VIN) CLI'

    desc 'Transliterates a VIN character'
    arg_name 'character'
    command :transliterate do |c|
      c.action do |_global, _options, args|
        puts Vindetta::Transliterator.run(args.first)
      end
    end

    desc 'Validates a VIN'
    command [:validate, :v] do |c|
      c.action do |_global, _options, args|
        puts Vindetta::Validator.run(args.first)
      end
    end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vindetta-0.6.0 lib/vindetta/cli.rb