Sha256: a1189c0c0725fa444585fd52cfbf8b98ca0a9ae348cf324dd73b5dd7791c726e

Contents?: true

Size: 675 Bytes

Versions: 8

Compression:

Stored size: 675 Bytes

Contents

# frozen_string_literal: true

require 'thor'

require 'spandx'
require 'spandx/command'
require 'spandx/commands/scan'

module Spandx
  class CLI < Thor
    Error = Class.new(StandardError)

    desc 'version', 'spandx version'
    def version
      puts "v#{Spandx::VERSION}"
    end
    map %w[--version -v] => :version

    desc 'scan LOCKFILE', 'Command description...'
    method_option :help, aliases: '-h', type: :boolean,
                         desc: 'Display usage information'
    def scan(lockfile = nil)
      if options[:help]
        invoke :help, ['scan']
      else
        Spandx::Commands::Scan.new(lockfile, options).execute
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
spandx-0.3.0 lib/spandx/cli.rb
spandx-0.2.0 lib/spandx/cli.rb
spandx-0.1.7 lib/spandx/cli.rb
spandx-0.1.6 lib/spandx/cli.rb
spandx-0.1.5 lib/spandx/cli.rb
spandx-0.1.4 lib/spandx/cli.rb
spandx-0.1.3 lib/spandx/cli.rb
spandx-0.1.2 lib/spandx/cli.rb