rdoc icon indicating copy to clipboard operation
rdoc copied to clipboard

Commandline option -f doesn't override RDOCOPT's value

Open Quintus opened this issue 14 years ago • 2 comments

Hi there,

RDoc's help states this:

    Options can be specified via the RDOCOPT environment variable, which
    functions similar to the RUBYOPT environment variable for ruby.

      $ export RDOCOPT="--show-hash"

    will make rdoc show hashes in method links by default.  Command-line options
    always will override those in RDOCOPT.

However, this is not true for the -f commandline option as can be seen in this gist (the interesting part is the last execution of RDoc where I set RDOCOPT to -f hanna and request darkfish via rdoc -f darkfish.

Instead of RDoc using darkfish instead of RDOCOPT's hanna, RDoc states this:

    invalid options: -f generator already set to hanna
    (invalid options are ignored)

and continues to use the hanna generator.

ruby -v: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux] rdoc --version: rdoc 3.9.2 OS: Arch Linux

Valete, Marvin

PS: Shouldn't the --formatter option be named --generator? darkfish, hanna, and all those are generators rather than formatters.

Quintus avatar Aug 19 '11 11:08 Quintus

--formatter is used instead of --generator for historical reasons. It's very difficult to change command-line options.

drbrain avatar Aug 19 '11 23:08 drbrain

Looking at this bug, it appears to be difficult to fix. --format pulls in options from the selected formatter, so a two pass parse run may be necessary to prevent pollution by the overridden generator.

drbrain avatar Oct 05 '11 00:10 drbrain