Class: Puppet::Application::Describe

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

Constant Summary

Constants inherited from Puppet::Application

DOCPATTERN

Constants included from Util

Util::AbsolutePathPosix, Util::AbsolutePathWindows

Instance Attribute Summary

Attributes inherited from Puppet::Application

#command_line, #options

Instance Method Summary collapse

Methods inherited from Puppet::Application

[], banner, clear!, clear?, #configure_indirector_routes, controlled_run, exit, find, #handlearg, #initialize, interrupted?, #name, option, option_parser_commands, #parse_options, restart!, restart_requested?, #run, #run_command, run_mode, #set_run_mode, #setup_logs, should_not_parse_config, should_parse_config, #should_parse_config?, should_parse_config?, stop!, stop_requested?

Methods included from Util

absolute_path?, activerecord_version, benchmark, binread, chuser, classproxy, #execfail, #execpipe, execute, execute_posix, execute_windows, logmethods, memory, path_to_uri, proxy, replace_file, safe_posix_fork, symbolize, symbolizehash, symbolizehash!, synchronize_on, thinmark, #threadlock, uri_to_path, wait_for_output, which, withumask

Methods included from Util::POSIX

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

Constructor Details

This class inherits a constructor from Puppet::Application

Instance Method Details

#helpObject



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
230
231
232
233
234
# File 'lib/vendor/puppet/application/describe.rb', line 183

def help
  "\npuppet-describe(8) -- Display help about resource types\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 Labs, LLC Licensed under the Apache 2.0 License\n\n"
end

#mainObject



240
241
242
243
244
245
246
247
248
# File 'lib/vendor/puppet/application/describe.rb', line 240

def main
  doc = TypeDoc.new

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

#preinitObject



236
237
238
# File 'lib/vendor/puppet/application/describe.rb', line 236

def preinit
  options[:parameters] = true
end

#setupObject



250
251
252
253
254
# File 'lib/vendor/puppet/application/describe.rb', line 250

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