Util-Linux package development
 help / color / mirror / Atom feed
From: Masatake YAMATO <yamato@redhat.com>
To: kzak@redhat.com
Cc: bensberg@telfort.nl, util-linux@vger.kernel.org
Subject: Re: [PATCH 3/7] lsfd: improve grammar, and use angular brackets around placeholder word
Date: Wed, 30 Apr 2025 04:54:41 +0900 (JST)	[thread overview]
Message-ID: <20250430.045441.583220097476882528.yamato@redhat.com> (raw)
In-Reply-To: <3vy4ysebkufi3zpcv2s66nnzghsf7nu4fthkmzotj6ctxawnd5@ottmham4b2lu>

From: Karel Zak <kzak@redhat.com>
Subject: Re: [PATCH 3/7] lsfd: improve grammar, and use angular brackets around placeholder word
Date: Thu, 24 Apr 2025 12:05:07 +0200
> On Thu, Apr 24, 2025 at 06:55:05PM +0900, Masatake YAMATO wrote:
>> > Also, use dots instead of "(s)" to indicate possible multiple arguments,
>> > and don't use "<when>" when the possible arguments differ from "always",
>> > "never", "auto".
>> > 
>> > Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
>> > ---
>> >  lsfd-cmd/lsfd.c | 6 +++---
>> >  1 file changed, 3 insertions(+), 3 deletions(-)
>> > 
>> > diff --git a/lsfd-cmd/lsfd.c b/lsfd-cmd/lsfd.c
>> > index 2eb53935c..3610de8dd 100644
>> > --- a/lsfd-cmd/lsfd.c
>> > +++ b/lsfd-cmd/lsfd.c
>> > @@ -2190,14 +2190,14 @@ static void __attribute__((__noreturn__)) usage(void)
>> >  	fputs(_(" -o, --output <list>          output columns (see --list-columns)\n"), out);
>> >  	fputs(_(" -r, --raw                    use raw output format\n"), out);
>> >  	fputs(_(" -u, --notruncate             don't truncate text in columns\n"), out);
>> > -	fputs(_(" -p, --pid  <pid(s)>          collect information only specified processes\n"), out);
>> > +	fputs(_(" -p, --pid <pid>...           collect information only for specified processes\n"), out);
>> 
>> This change implies that --pid 1 2 3 works.
>> However, specifying multiple pids to one --pid doesn't work.
>> 
>>    # lsfd --pid 1 $$
>>    Try 'lsfd --help' for more information.
>> 
>> Only --pid "1 2 3"  or works. See double-quote chars.
>> 
>>    # lsfd --pid "1 $$"
> 
> It also supports comma, it means --pid 1,2,3
> 
> It would be better to not announce that space is possible to use as
> separator, and use comma in the help and man page
> 
>   fputs(_(" -p, --pid <list>           restrict to specified processes (command separated pids)\nn"), out);
> 
> or so ...

I added code supporting whitespace as a separator for combining lsfd with
pidof, as I wrote as an example in lsfd(1):

       # lsfd --pid "$(pidof firefox)"

The idea combining with pidof comes from strace.

The -p option of strace supported whitespace as a separator.
So we can run strace with pidof like:

       # strace -p "$(pidof firefox)"

I didn't know this smart feature.
So I added -S option, an option for specifying separator to pidof ago.

    $ pidof -S ' -p ' zsh
    4185021 -p 4161716 -p 4156470 -p 4155385
    $ strace -p $(pidof -S ' -p ' zsh)

https://gitlab.com/procps-ng/procps/-/commit/73492b182dc60c1605d1b0d62de651fad97807af
https://lists.strace.io/pipermail/strace-devel/2018-March/007950.html
https://lists.strace.io/pipermail/strace-devel/2018-March/007951.html
https://lists.strace.io/pipermail/strace-devel/2018-March/007952.html

That was a small thing but impressive study for me.

Simplifying the output of --help is nice
However, from the man page, I want to keep the description of -p
supporting whitespace as a separator.

Masatake YAMATO

>     Karel
> 
> -- 
>  Karel Zak  <kzak@redhat.com>
>  http://karelzak.blogspot.com
> 


  parent reply	other threads:[~2025-04-29 19:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-24  9:32 [PATCH 1/7] unshare: make the wording of a message identical to that of three others Benno Schulenberg
2025-04-24  9:32 ` [PATCH 2/7] irqtop: make the wording of an error message identical to that of another Benno Schulenberg
2025-04-24  9:32 ` [PATCH 3/7] lsfd: improve grammar, and use angular brackets around placeholder word Benno Schulenberg
2025-04-24  9:55   ` Masatake YAMATO
2025-04-24 10:05     ` Karel Zak
2025-04-25 10:36       ` Benno Schulenberg
2025-04-29 19:54       ` Masatake YAMATO [this message]
2025-04-30  8:20         ` Benno Schulenberg
2025-04-24  9:32 ` [PATCH 4/7] docs,usage: harmonize description of --hyperlink, and add 2 missing ones Benno Schulenberg
2025-04-24 10:08   ` Karel Zak
2025-04-25 10:43     ` Benno Schulenberg
2025-04-25 20:07       ` Karel Zak
2025-04-24  9:32 ` [PATCH 5/7] pipesz: (man) improve the markup and some wordings Benno Schulenberg
2025-04-24  9:32 ` [PATCH 6/7] pipesz: report default size in --help, instead of referring the user Benno Schulenberg
2025-04-24 11:28   ` Nathan Sharp
     [not found]   ` <MN0P221MB1530A6F07A44AF169879CBA7C2852@MN0P221MB1530.NAMP221.PROD.OUTLOOK.COM>
2025-04-24 13:15     ` Benno Schulenberg
2025-04-24  9:32 ` [PATCH 7/7] uuidd: put an option and its description in a single message Benno Schulenberg
2025-04-29 11:11 ` [PATCH 1/7] unshare: make the wording of a message identical to that of three others Karel Zak
2025-04-29 13:55   ` Benno Schulenberg
2025-04-30 11:18     ` Karel Zak
2025-04-30 11:19       ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250430.045441.583220097476882528.yamato@redhat.com \
    --to=yamato@redhat.com \
    --cc=bensberg@telfort.nl \
    --cc=kzak@redhat.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox