Class: Puppet::Application::Describe

Inherits:
Puppet::Application show all
Defined in:
lib/puppet/application/describe.rb

Constant Summary

Constants inherited from Puppet::Application

DOCPATTERN

Constants included from Util

Util::AbsolutePathPosix, Util::AbsolutePathWindows, Util::DEFAULT_POSIX_MODE, Util::DEFAULT_WINDOWS_MODE, Util::RFC_3986_URI_REGEX

Constants included from Util::SymbolicFileMode

Util::SymbolicFileMode::SetGIDBit, Util::SymbolicFileMode::SetUIDBit, Util::SymbolicFileMode::StickyBit, Util::SymbolicFileMode::SymbolicMode, Util::SymbolicFileMode::SymbolicSpecialToBit

Constants included from Util::POSIX

Util::POSIX::LOCALE_ENV_VARS, Util::POSIX::USER_ENV_VARS

Instance Attribute Summary

Attributes inherited from Puppet::Application

#command_line, #options

Instance Method Summary collapse

Methods inherited from Puppet::Application

[], #app_defaults, available_application_names, banner, clear!, clear?, clear_everything_for_tests, #configure_indirector_routes, controlled_run, #deprecate, #deprecated?, environment_mode, exit, find, get_environment_mode, #handle_logdest_arg, #handlearg, #initialize, #initialize_app_defaults, interrupted?, #log_runtime_environment, #name, option, option_parser_commands, #parse_options, restart!, restart_requested?, #run, #run_command, run_mode, #set_log_level, #setup_logs, stop!, stop_requested?, try_load_class

Methods included from Util

absolute_path?, benchmark, chuser, clear_environment, default_env, deterministic_rand, deterministic_rand_int, exit_on_fail, get_env, get_environment, logmethods, merge_environment, path_to_uri, pretty_backtrace, replace_file, safe_posix_fork, set_env, symbolizehash, thinmark, uri_encode, uri_query_encode, uri_to_path, which, withenv, withumask

Methods included from Util::SymbolicFileMode

#normalize_symbolic_mode, #symbolic_mode_to_int, #valid_symbolic_mode?

Methods included from Util::POSIX

#get_posix_field, #gid, groups_of, #idfield, #methodbyid, #methodbyname, #search_posix_field, #uid

Constructor Details

This class inherits a constructor from Puppet::Application

Instance Method Details

#helpObject


178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/puppet/application/describe.rb', line 178

def help
  "\npuppet-describe(8) -- \#{summary}\n========\n\nSYNOPSIS\n--------\nPrints help about Puppet resource types, providers, and metaparameters.\n\n\nUSAGE\n-----\npuppet describe [-h|--help] [-s|--short] [-p|--providers] [-l|--list] [-m|--meta]\n\n\nOPTIONS\n-------\n* --help:\nPrint this help text\n\n* --providers:\nDescribe providers in detail for each type\n\n* --list:\nList all types\n\n* --meta:\nList all metaparameters\n\n* --short:\nList only parameters without detail\n\n\nEXAMPLE\n-------\n$ puppet describe --list\n$ puppet describe file --providers\n$ puppet describe user -s -m\n\n\nAUTHOR\n------\nDavid Lutterkort\n\n\nCOPYRIGHT\n---------\nCopyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License\n\n"
end

#mainObject


235
236
237
238
239
240
241
242
243
# File 'lib/puppet/application/describe.rb', line 235

def main
  doc = TypeDoc.new

  if options[:list]
    doc.list_types
  else
    options[:types].each { |name| doc.format_type(name, options) }
  end
end

#preinitObject


231
232
233
# File 'lib/puppet/application/describe.rb', line 231

def preinit
  options[:parameters] = true
end

#setupObject


245
246
247
248
249
# File 'lib/puppet/application/describe.rb', line 245

def setup
  options[:types] = command_line.args.dup
  handle_help(nil) unless options[:list] || options[:types].size > 0
  $stderr.puts "Warning: ignoring types when listing all types" if options[:list] && options[:types].size > 0
end

#summaryObject


174
175
176
# File 'lib/puppet/application/describe.rb', line 174

def summary
  _("Display help about resource types")
end