mainDatabase-driven manual pager suite - Support: sr #108684, "man -k -l word" does...

 
 

sr #108684: "man -k -l word" does not show full header line

Submitter:  Dale Worley <worley>
Submitted:  Thu 13 Nov 2014 04:59:13 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 13 Nov 2014 04:59:13 PM UTC, original submission:  

(Brought upstream from https://bugzilla.redhat.com/show_bug.cgi?id=1161747)

Description of problem:

The manual page for "man" gives this form for getting summary lines:

       man -k [apropos options] regexp ...

The manual page for "apropos" shows that the -l option can be used to prevent trimming of displayed lines to the terminal width.  Nonetheless, the form:

       man -k -l regexp

does not show the full lines, they are trimmed to the terminal width.  (No error message is given, either.)

Version-Release number of selected component (if applicable):

man-db-2.6.3-8.fc19.x86_64

How reproducible:

Reliably reproducible.

Steps to Reproduce:
1. "man -k -l attribute"

Actual results:

Displayed lines are truncated to terminal width.  E.g.,

add_wchnstr (3x)     - add an array of complex characters (and attributes) to ...

Expected results:

The same output as for "apropos -l", that is, not truncated.  E.g.,

add_wchnstr (3x)     - add an array of complex characters (and attributes) to a curses window

Additional info:

The Red Hat people fixed their version so that -l after -k would be passed on to apropos.  This solves my immediate problem but does not bring man into compliance with its manual page.

Given the simplicity of the "man -k" form, I'd think it would be easier to invoke apropos directly, just passing it the remaining arguments without any analysis:

char const *new_argv = malloc(argc sizeof (char * const));
new_argv[0] = "apropos";
memcpy(new_argv + 1, argv + 2, (argc - 1) sizeof (char const));
execvp("apropos", new_argv);

That way man doesn't need to know anything about the arguments to apropos in order to support them all.

This does introduce additional complexity into the processing of the -k option, but that seems to be supportable because the documented use of -k is very restrictive:  It must appear alone as the first option.  So if -k is seen as ARGV[1], it would be processed as shown above, and if it is a later option, it is an error.

Dale Worley <worley>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by worley (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code