Sha256: ff3b9db4087e5a4de8a8ec71318a2303765ef8b8d463c44d2ed10fe233b3d7dd

Contents?: true

Size: 805 Bytes

Versions: 4

Compression:

Stored size: 805 Bytes

Contents

# Get the facts terminus. Generally this is 'yaml' and a fact file will be loaded from PuppetDB or
# elsewhere in the environment. However it can be set to 'facter' which will run facter on the host
# on which this is running.
# @param parser [OptionParser object] The OptionParser argument
# @param options [Hash] Options hash being constructed; this is modified in this method.
OctocatalogDiff::CatalogDiff::Cli::Options::Option.newoption(:facts_terminus) do
  has_weight 310

  def parse(parser, options)
    termini = %w(yaml facter)
    parser.on('--facts-terminus STRING', "Facts terminus: one of #{termini.join(', ')}") do |x|
      raise ArgumentError, "Invalid facts terminus #{x}; supported: #{termini.join(', ')}" unless termini.include?(x)
      options[:facts_terminus] = x
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
octocatalog-diff-0.5.6 lib/octocatalog-diff/catalog-diff/cli/options/facts_terminus.rb
octocatalog-diff-0.5.4 lib/octocatalog-diff/catalog-diff/cli/options/facts_terminus.rb
octocatalog-diff-0.5.3 lib/octocatalog-diff/catalog-diff/cli/options/facts_terminus.rb
octocatalog-diff-0.5.1 lib/octocatalog-diff/catalog-diff/cli/options/facts_terminus.rb