← Back to context

Comment by onetruepretzel

8 years ago

I must admit I'm not a fan of this. I feel like the work could go towards submitting patches to the man pages. The MAN page layout [0] allows for an EXAMPLES section which serves this purpose. Great effort in creating this tool but I think it's replicating functionality already provided by the man pages. I've submitted patches for MAN pages for GNU tools in the past and the creators are very receptive to updates.

[0] - https://en.wikipedia.org/wiki/Man_page#Layout

Yup, and the examples section is usually last, with no possibility to jump directly to it

  • > and the examples section is usually last

    A far better answer to this would have been a project to (1) improve man page examples, and then (2) create a small alternative man page client that displays only the examples (or puts them up top).

    Having said that I do see the need for what tldr is doing, even though I would have preferred it added to existing tools. More often than not I only find man pages useful after I have needed to look up something. They're usually OK for wholistic understanding, but often too dense and assuming of far too much contextual knowledge to be useful in the heat of battle.

  • You can jump to it by typing /EXAMPLES<enter>

    Or if that seems like a lot of keystrokes, /EX<enter> will probably jump to what you want most of the time too.

    • "probably"

         > man less
      
         /EX
         pattern not found
      
         /ex
         ends up somewhere in the middle of the text 
         on a word that contains ex

  • > with no possibility to jump directly to it

    How about '/examples'? Maybe you should take some time to actually learn how 'man' works before you start bashing it online...

  •     $ cat ~/.bin/eg
        #!/bin/bash
        man $@ | awk '/^EXAMPLE/ { getline; while ($0 !~ /^[A-Z]+/) { print $0; getline; } }'