/usr/lib/ruby/vendor_ruby/octocatalog-diff/cli/options/pass_env_vars.rb is in octocatalog-diff 1.5.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # frozen_string_literal: true
# One or more environment variables that should be made available to the Puppet binary when parsing
# the catalog. For example, --pass-env-vars FOO,BAR will make the FOO and BAR environment variables
# available. Setting these variables is your responsibility outside of octocatalog-diff.
# @param parser [OptionParser object] The OptionParser argument
# @param options [Hash] Options hash being constructed; this is modified in this method.
OctocatalogDiff::Cli::Options::Option.newoption(:pass_env_vars) do
has_weight 600
def parse(parser, options)
descriptive_text = 'Environment variables to pass'
parser.on('--pass-env-vars VAR1[,VAR2[,...]]', Array, descriptive_text) do |res|
options[:pass_env_vars] ||= []
res.each do |item|
raise ArgumentError, "Environment variable #{item} must be in alphanumeric format!" unless item =~ /^\w+$/
options[:pass_env_vars] << item
end
end
end
end
|