Sha256: de6a02f4a91cdd13c82dd6dc2d4301b4ba51d80983c1066c848f7b4943df9142

Contents?: true

Size: 706 Bytes

Versions: 1

Compression:

Stored size: 706 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, :t] 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.7.0 lib/vindetta/cli.rb