Sha256: 096ec98eaab3419737869104801833eb15b374988db1f8063d247bd3720ce5c3

Contents?: true

Size: 1.94 KB

Versions: 70

Compression:

Stored size: 1.94 KB

Contents

require 'optparse'
require 'pathname'
require 'origen/commands/helpers'

module Origen
  options = {}

  # App options are options that the application can supply to extend this command
  app_options = @application_options || []
  opt_parser = OptionParser.new do |opts|
    opts.banner = <<-END
  env [filters...] Shows the current site environment configuration. Analogous to 'env' for shell environment.
                  In other words, lists all the site config variables and their values.
                  Aliased to 'environment'.

  configs         Shows the current config files used and their indexes.

  inspect_config [config_indexes...] Inspects the configuration(s) at each index given.
                                     Indexes can be found from 'origen site configs'
                                     If no indexes are given, all configs are printed.

  inspect_variable [variable_names...] Inspects and traces the variable(s) through the various sites configs.

  refresh         Forces a refresh of the centralized site config. This will reset the timer for the next automatc refresh.
    END

    # Apply any application option extensions to the OptionParser
    Origen::CommandHelpers.extend_options(opts, app_options, options)
    opts.separator ''
    opts.on('-h', '--help', 'Show this message') { puts opts; exit }
  end
  opt_parser.parse! ARGV

  if ARGV[0]
    case ARGV.shift
    when 'env', 'environment'
      Origen.site_config.pretty_print_env(*ARGV)
    when 'configs'
      Origen.site_config.pretty_print_configs
    when 'inspect_config', 'inspect_configs'
      Origen.site_config.inspect_config(*ARGV)
    when 'inspect_variable', 'inspect_variables'
      Origen.site_config.inspect_variable(*ARGV)
    when 'refresh'
      Origen.site_config.refresh
    else
      puts "Unknown command, see 'origen site -h' for a list of commands"
    end
  else
    puts "You must supply a command, see 'origen site -h' for a list of commands"
  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
origen-0.60.17 lib/origen/commands/site.rb
origen-0.60.16 lib/origen/commands/site.rb
origen-0.60.14 lib/origen/commands/site.rb
origen-0.60.13 lib/origen/commands/site.rb
origen-0.60.12 lib/origen/commands/site.rb
origen-0.60.11 lib/origen/commands/site.rb
origen-0.60.10 lib/origen/commands/site.rb
origen-0.60.9 lib/origen/commands/site.rb
origen-0.60.8 lib/origen/commands/site.rb
origen-0.60.7 lib/origen/commands/site.rb
origen-0.60.6 lib/origen/commands/site.rb
origen-0.60.5 lib/origen/commands/site.rb
origen-0.60.4 lib/origen/commands/site.rb
origen-0.60.3 lib/origen/commands/site.rb
origen-0.60.2 lib/origen/commands/site.rb
origen-0.60.1 lib/origen/commands/site.rb
origen-0.60.0 lib/origen/commands/site.rb
origen-0.59.8 lib/origen/commands/site.rb
origen-0.59.7 lib/origen/commands/site.rb
origen-0.59.6 lib/origen/commands/site.rb