[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: what is the use of -c parameter of column(1), can you demonstrate with an example?



On 2010-11-03 09:44:04 +0800, Zhang Weiwu wrote:
> Can someone dealt with gnu before tell if gnu utilities too bureaucratic
> to accept any change? If they still can accept some change, I would like
> to request an update the man page (I wouldn't file a bug just to wait
> for it to sink in some decades).

I find that the column utility belongs to bsdmainutils package, so
it's a BSD application, not a GNU one. I think it would make sense to
file a bug, since you want to offer an improvement.

> It says:
> 
>      The column utility formats its input into multiple columns.  Rows are
>      filled before columns.  Input is taken from file operands, or, by
>      default, from the standard input.  Empty lines are ignored.
> 
>      The options are as follows:
> 
>      -c      Output is formatted for a display columns wide.
> 
>      -t      Determine the number of columns the input contains and create a
>              table.  Columns are delimited with whitespace, by default, or
>              with the characters supplied using the -s option.  Useful for
>              pretty-printing displays.
> 
> 
> This man page have 2 problems. First:
> 
>     The first paragraph's mentioning of 'column' obviously means
>     something different than the '-c' paragraph's mentioning of 'column'.
> 
>     In the first paragraph it means what we usually mean column in
>     typography, like on daily newspaper: one or more vertical blocks of
>     text positioned on a page, usually wraps at 3 to 10 words per line.
> 
>     The '-c' paragraph it means what column means in man stty(1).

The manual page seems terse to me, but I understand it. When I view
man pages, certain things show up as bold and as underlined.  Does that
happen on your system or locale? So when I read the option for -c, to
me it looks like this:

    -c      Output is formatted for a display <ul>columns</ul> wide.

On my system, uderlined text is shown in a different color. Because
the word "columns" is in a different color, I know they are referring
to some kind of variable or argument. Then I can refer to the
synopsis and try to decipher what they mean by "column".

I still agree with you that the manual page could be improved, by the way.
But I wanted to mention the underline thing, because those don't show
up in these emails, and might not show up on everyone's computer.

> Second problem:
> 
>     The usage with -t is to form a table, which, although code level
>     implementation is similar to multi-column layout, in fact is a very
>     different usage than what is mentioned in the first paragraph.

I agree with you that the column command has a dual function (tables
and columns), and that the dual function is not reflected in the man
page. It seems like they tried to make the man page terse. I prefer
longer and better explanations, but some people don't see it that way.

> A less confusing version from a non-English speaker would be to change
> it to:
> 
>     The column utility formats its input into a multi-column layout or
>     to a table. By default it forms a multi-column layout, taking the
>     input, filling rows before columns. With -t it forms a table,
>     expanding the field separator to align table columns.
> 
>     The options are as follows:
> 
>     -c columns
>         Output is formatted for a terminal that has that number of
>         columns. Default is the current terminal's column number. Refer
>         to stty(1) for more info about terminal columns. A character is
>         as wide as one or two columns of a terminal.
> 
>     -t
>         Create a table instead of making a multi-column layout. Columns
>         are delimited with whitespace, by default, or with the
>         characters supplied using the -s option. Useful for
>         pretty-printing tabular data.

Seems better to me. The people who wrote the original man page almost
certainly were not considering non-English speakers.

Phil


Reply to: