As a preface to critique, a few words of appreciation: 'dlocate'
is a good program I use a lot. Discovered it a few years ago reading
Steele's "Useful Debian Stuff" page -- GLS was right! Hail to ye
authors and maintainers; e.g. our collective benefactor C. Sanders.
Thanks for keeping it out there.
"And now for something completely different..."
On Fri, 24 Mar 2006 08:51:28 +1100
Craig Sanders <[EMAIL PROTECTED]> wrote:
> On Wed, Mar 22, 2006 at 01:32:31AM -0500, A Costa wrote:
> > Why not just print the whole pathname of the man page?
>
> because the point of 'dlocate -man' is that you can run
>
> man `dlocate -man package_name`
>
> and view all the man pages for a package without having to type or
> cut-and-paste their names.
Not a problem; see below for details.
> > The algorithm and output would be something like:
> >
> > % dlocate -L bash | grep ".*/man.*.gz" | sort
>
> precisely. if you just want a list of man page filenames, you can use
> grep as above. no need for a command-line option for it.
Well, my one-liner above is a less convenient way to get full
pathnames; it usually takes a bit of fussing before one discovers the
right wildcard or regexp for grep. A suitable command line option can
save time.
On your first example above, there seems to be an assumption
that full pathnames are incompatible with 'man'. That's not obvious
though; on my system this works:
% man /usr/share/man/man1/bash.1.gz
...and even this works:
% man `dlocate -L bash | grep ".*/man.*.gz" | sort`
> what has any of this got to do with "duplicated man entries"? i see no
> duplicates, or any evidence of them. just a misunderstanding of what
> the '-man' option is for.
Most man pages explain what options do, less often what they're for.
'man dlocate' explains what the '-man' option does, that is, describes
the HOW of it. It doesn't say what it's for, it's origin, or the WHY
of it, nor is that information anywhere that I know of in the user
docs. It seems uncharitable to say users _misunderstood_ a motive not
given -- at worst errant users _guessed_ wrong.
(Often it's a good thing not to explain why, as users may find
entirely new uses for a thing, unforeseen by its maker.)
As for duplicates, these aren't unique lines:
% dlocate -man aptitude
8 aptitude
8 aptitude
8 aptitude.fr
8 aptitude
8 aptitude.fi
8 aptitude
8 aptitude
8 aptitude
8 aptitude
8 aptitude
# how many dups was it?
% dlocate -man aptitude | sort | uniq -cd
8 8 aptitude # 8 dups
Worse, if I try this:
% man `dlocate -man aptitude`
...and keep hitting 'q' & <Enter>, the same man page shows up 8 times.
There are no repeats with this:
% man `dlocate -L aptitude | grep ".*/man.*.gz" | sort`
So for that example at least, full pathnames are better.
NB: my one-liner's not perfect. Packages with many symlinks to
man pages would cause repeats even with that code. Maybe the worst
possible example:
# how many symlinked man pages in 'manpages-dev'?
% for f in `dlocate -L manpages-dev | grep ".*/man.*.gz"`; do file $f |
grep symbolic ; done | wc -l
881 # <<-- that many
I-yi-yi! So the ideal would be a '-man' option that eliminated
symlinks, or could if desired. Displaying only the local
language pages would be convenient too.
Hope this helps...
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]