This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: makewhatis -s option can't take >1 parameters

>>>>> "Matthew" == Matthew Carter writes:

    Matthew> I found that the "-s" option to makewhatis cannot take
    Matthew> multiple sections.  If you try to supply multiple
    Matthew> sections, they are incorrectly interpreted as a
    Matthew> manpath.

    Matthew> For example:
    Matthew> % makewhatis -s '1 2'
    Matthew> No such directory 2

    Matthew> You might wonder why anyone would ever want to use
    Matthew> "-s".  (A comment in the code says that it might be
    Matthew> obsoleted soon.)  I need to use "-s" because section
    Matthew> 8c, containing imapd, is not supplied in the default
    Matthew> section list.  However, if I use "makewhatis -s 8c"

Check out the test version of man (man-1.5k.1) which has 8c in the section list.

    Matthew> alone, the whatis database loses information about all
    Matthew> the other sections.  I need to be able to run
    Matthew> "makewhatis -s '1 2 3 4 5 6 7 8 9 n l 8c'".

    Matthew> I looked into the source, and determined that there is
    Matthew> a simple fix.  The problem is caused by the use of $*
    Matthew> in a 'for' loop to reference the command-line
    Matthew> arguments.  This causes any argument that contains
    Matthew> multiple words to become multiple arguments.  The "$@"
    Matthew> construct is specifically designed to work around
    Matthew> this: bash expands "$@" to a quoted word for every
    Matthew> argument.

    Matthew> Thus, changing line 71 from:
    Matthew> for name in $*
    Matthew> to:
    Matthew> for name in "$@"
    Matthew> solves the problem.

I will consider this in the next version of man.

    Matthew> I hope this is helpful.

Yes, thanks

    Matthew> -Matt Carter


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]