Module Options::OptionList
In: options.rb



OPTION_LIST = [ [ "--accessor", "-A", "accessorname[,..]", "comma separated list of additional class methods\n" + "that should be treated like 'attr_reader' and\n" + "friends. Option may be repeated. Each accessorname\n" + "may have '=text' appended, in which case that text\n" + "appears where the r/w/rw appears for normal accessors."], [ "--all", "-a", nil, "include all methods (not just public)\nin the output" ], [ "--charset", "-c", "charset", "specifies HTML character-set" ], [ "--debug", "-D", nil, "displays lots on internal stuff" ], [ "--diagram", "-d", nil, "Generate diagrams showing modules and classes.\n" + "You need dot V1.8.6 or later to use the --diagram\n" + "option correctly. Dot is available from\n"+ "" ], [ "--exclude", "-x", "pattern", "do not process files or directories matching\n" + "pattern. Files given explicitly on the command\n" + "line will never be excluded." ], [ "--extension", "-E", "new=old", "Treat files ending with .new as if they ended with\n" + ".old. Using '-E cgi=rb' will cause xxx.cgi to be\n" + "parsed as a Ruby file"], [ "--fileboxes", "-F", nil, "classes are put in boxes which represents\n" + "files, where these classes reside. Classes\n" + "shared between more than one file are\n" + "shown with list of files that sharing them.\n" + "Silently discarded if --diagram is not given\n" + "Experimental." ], [ "--fmt", "-f", "format name", "set the output formatter (see below)" ], [ "--help", "-h", nil, "you're looking at it" ], [ "--help-output", "-O", nil, "explain the various output options" ], [ "--ignore-case", "-C", nil, "The case of names of classes or modules\n" + "or methods are ignored" ], [ "--image-format", "-I", "gif/png/jpg/jpeg", "Sets output image format for diagrams. Can\n" + "be png, gif, jpeg, jpg. If this option is\n" + "omitted, png is used. Requires --diagram." ], [ "--include", "-i", "dir[,dir...]", "set (or add to) the list of directories\n" + "to be searched when satisfying :include:\n" + "requests. Can be used more than once." ], [ "--inline-source", "-S", nil, "Show method source code inline, rather\n" + "than via a popup link" ], [ "--line-numbers", "-N", nil, "Include line numbers in the source code" ], [ "--main", "-m", "name", "'name' will be the initial page displayed" ], [ "--merge", "-M", nil, "when creating ri output, merge processed classes\n" + "into previously documented classes of the name name"], [ "--one-file", "-1", nil, "put all the output into a single file" ], [ "--op", "-o", "dir", "set the output directory" ], [ "--opname", "-n", "name", "Set the 'name' of the output. Has no\n" + "effect for HTML." ], [ "--promiscuous", "-p", nil, "When documenting a file that contains a module\n" + "or class also defined in other files, show\n" + "all stuff for that module/class in each files\n" + "page. By default, only show stuff defined in\n" + "that particular file." ], [ "--quiet", "-q", nil, "don't show progress as we parse" ], [ "--ri", "-r", nil, "generate output for use by 'ri.' The files are\n" + "stored in the '.rdoc' directory under your home\n"+ "directory unless overridden by a subsequent\n" + "--op parameter, so no special privileges are needed." ], [ "--ri-site", "-R", nil, "generate output for use by 'ri.' The files are\n" + "stored in a site-wide directory, making them accessible\n"+ "to others, so special privileges are needed." ], [ "--ri-system", "-Y", nil, "generate output for use by 'ri.' The files are\n" + "stored in a system-level directory, making them accessible\n"+ "to others, so special privileges are needed. This option\n"+ "is intended to be used during Ruby installations" ], [ "--show-hash", "-H", nil, "A name of the form #name in a comment\n" + "is a possible hyperlink to an instance\n" + "method name. When displayed, the '#' is\n" + "removed unless this option is specified" ], [ "--style", "-s", "stylesheet url", "specifies the URL of a separate stylesheet." ], [ "--tab-width", "-w", "n", "Set the width of tab characters (default 8)"], [ "--template", "-T", "template name", "Set the template used when generating output" ], [ "--title", "-t", "text", "Set 'txt' as the title for the output" ], [ "--version", "-v", nil, "display RDoc's version" ], [ "--webcvs", "-W", "url", "Specify a URL for linking to a web frontend\n" + "to CVS. If the URL contains a '\%s', the\n" + "name of the current file will be substituted;\n" + "if the URL doesn't contain a '\%s', the\n" + "filename will be appended to it." ], ]

Public Class methods

Show an error and exit


     # File options.rb, line 263
263:     def OptionList.error(msg)
264:       $stderr.puts
265:       $stderr.puts msg
266:       $stderr.puts "\nFor help on options, try 'rdoc --help'\n\n"
267:       exit 1
268:     end


     # File options.rb, line 321
321:     def OptionList.help_output
322:       OptionList.strip_output("How RDoc generates output depends on the output formatter being\nused, and on the options you give.\n\n- HTML output is normally produced into a number of separate files\n(one per class, module, and file, along with various indices).\nThese files will appear in the directory given by the --op\noption (doc/ by default).\n\n- XML output by default is written to standard output. If a\n--opname option is given, the output will instead be written\nto a file with that name in the output directory.\n\n- .chm files (Windows help files) are written in the --op directory.\nIf an --opname parameter is present, that name is used, otherwise\nthe file will be called rdoc.chm.\n\nFor information on other RDoc options, use \"rdoc --help\".\n")
323:       exit 0
324:     end


     # File options.rb, line 243
243:     def OptionList.options
244: do |long, short, arg,|
245:         [ long, 
246:           short, 
247:           arg ? GetoptLong::REQUIRED_ARGUMENT : GetoptLong::NO_ARGUMENT 
248:         ]
249:       end
250:     end


     # File options.rb, line 253
253:     def OptionList.strip_output(text)
254:       text =~ /^\s+/
255:       leading_spaces = $&
256:       text.gsub!(/^#{leading_spaces}/, '')
257:       $stdout.puts text
258:     end

Show usage and exit


     # File options.rb, line 272
272:     def OptionList.usage(generator_names)
274:       puts
275:       puts(VERSION_STRING)
276:       puts
278:       name = File.basename($0)
279:       OptionList.strip_output("Usage:\n\n\#{name} [options]  [names...]\n\nFiles are parsed, and the information they contain\ncollected, before any output is produced. This allows cross\nreferences between all files to be resolved. If a name is a\ndirectory, it is traversed. If no names are specified, all\nRuby files in the current directory (and subdirectories) are\nprocessed.\n\nOptions:\n\n")
281:       OPTION_LIST.each do |long, short, arg, desc|
282:         opt = sprintf("%20s", "#{long}, #{short}")
283:         oparg = sprintf("%-7s", arg)
284:         print "#{opt} #{oparg}"
285:         desc = desc.split("\n")
286:         if arg.nil? || arg.length < 7
287:           puts desc.shift
288:         else
289:           puts
290:         end
291:         desc.each do |line|
292:           puts(" "*28 + line)
293:         end
294:         puts
295:       end
297:       puts "\nAvailable output formatters: " +
298:         generator_names.sort.join(', ') + "\n\n"
300:       puts "For information on where the output goes, use\n\n"
301:       puts "   rdoc --help-output\n\n"
303:       exit 0
304:     end