Sha256: 6690f9261eda0da60641280bef97f69143362948c3ed3f98e0ae93dc8b4d0eea
Contents?: true
Size: 1.05 KB
Versions: 13
Compression:
Stored size: 1.05 KB
Contents
#!/usr/bin/env ruby require 'prospectus' require 'mercenary' Mercenary.program(:prospectus) do |p| p.version Prospectus::VERSION p.description 'Tool and DSL for checking expected vs actual state' p.syntax 'prospectus [options]' # rubocop:disable Metrics/LineLength p.option :directory, '-d DIR', '--directory DIR', 'Change to directory before loading' p.option :good_only, '-g', '--good', 'Show only items with good state' p.option :all, '-a', '--all', 'Show all items' p.option :quiet, '-q', '--quiet', 'Hide all non-error output' p.option :json, '-j', '--json', 'Output results as json' # rubocop:enable Metrics/LineLength p.action do |_, options| options[:directory] ||= '.' Dir.chdir(options[:directory]) do results = Prospectus.load(options) unless options[:quiet] if options[:json] puts results.to_json else results.each { |x| puts "#{x.name}: #{x.actual} / #{x.expected}" } end end exit 1 unless results.empty? || options[:all] || options[:good_only] end end end
Version data entries
13 entries across 13 versions & 1 rubygems