coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] chroot,comm,join: fix usage options style


From: Pádraig Brady
Subject: Re: [PATCH] chroot,comm,join: fix usage options style
Date: Tue, 8 Dec 2020 17:59:15 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0

On 08/12/2020 17:12, Bernhard Voelker wrote:
On 12/8/20 12:49 AM, Pádraig Brady wrote:
As it happens we're currently working on a more general solution
to alignment of --help output, which should address this.

Yes, the idea is to output the usage texts in 3 columns: short option,
long option and description.  The question is if such automatic alignment
would lead to a nicely readable text.  The problem starts with:
- short options having arguments,
- several short options for the same thing: rm -r,-R
- several long options for the same thing: --quiet, --silent
etc.

Thus said, after fixing the above it would be hard to get better results
with automatic, columnar alignment without loosing too much space.

In that regard, the programs chroot, comm and join are just violating
the status quo: they do not align long-only options properly.
Therefore, I'm 60:40 to start with Arman's patches, yet fixing
the indentation of the description column in join and comm: see
attached (squashed) patch.

The only thing which is still a bit annoying is that the indentation
of the long option and the description via the HELP_OPTION_DESCRIPTION
and VERSION_OPTION_DESCRIPTION macros do not match that of the program.
We could address this by passing the number of necessary spaces as
parameters to the macros (and maybe change them into functions).

WDYT?

wrt the auto alignment,
I was considering using similar output to that of man pages.
I.E. single char options have descriptions on the same line,
while long options have the description starting on the next line.
Outputting to terminal, we might also highlight the `--option` line
to aid visual delineation.

Feel free to push Arman's patch, as it does improve things immediately.

thanks,
Pádraig



reply via email to

[Prev in Thread] Current Thread [Next in Thread]