Re: [PATCH 2/4] chrt: do not try to interpret the --pid option itself as a PID

Benno Schulenberg <[email protected]>
Newsgroups org.kernel.vger.util-linux
Message-ID <[email protected]>
Hello Vineeth,

Op 01-07-2025 om 07:05 schreef Madadi Vineeth Reddy:
> On 30/06/25 14:10, Benno Schulenberg wrote:
>> When not specifying a PID with --pid, `chrt` would report:
>>
>>    chrt: invalid PID argument: '--pid'
>>
>> That was silly.  After this change, `chrt --pid` will report:
>>
>>    chrt: too few arguments
> 
> IMO, the current message is already helpful, and I'm not sure
> the proposed one is much clearer.
> 
> Maybe something like --pid requires an argument would be clearer?

There's no need for that, because when the user specified -p or --pid
without any further argument, then saying "too few arguments" will be
enough.  No need to spell it out.  The advantage of this short message
is that it allows folding the messages for "too few arguments" into a
single one in the overnext commit.  Furthermore, the message is already
used in a few other util-linux tools, so it won't burden translators.

> Also, I noticed that currently more than one pid can't be passed
> if someone wants to update the custom slice for multiple pids at
> once. I can look into adding support for that if it's helpful.

I don't think that is a good idea: the current interface is already
confusing in that _gets_ info when a single argument follows --pid,
and that it _sets_ something when there a two arguments.  Allowing
to set something for multiple PIDs at once while it's not possible
to query multiple PIDs at once... is more confusing.


Benno
OpenPGP_signature.asc (application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEEFo5vQpe/16ea/USWUUu+Lrjhlh8FAmhj4/EFAwAAAAAACgkQUUu+Lrjhlh8D
SxAA3HbAtvJ+1nONYWtOI0ee3y6+fiavxadFnh7pn0WiAGVOBHHdcSTo3LHKhWCYiF+bi8uyhRrV
LzCmckPs8ULNR2CR4O1ohVkLFBgru6nGHXoLPaoCz98iePisTvaE6tUB6UeM8/jv2eXEWZM9Yd1Q
Xe4Qh5yNuruMEK47UGypMEGoXCKK9Z/e6G+nxtXWAGt2X8xv5vgqU+aCS7ft6DsAZqLAvk3zOKgl
vl47ktavb0IcvfWc4HgSy5Ug5un4FTlkLpnB0DHmFTEibpb+CojPxUKIRN6ShClaYoJZ7VRvcSuv
x1dQTkr14iHQAuSw4Xo5LQmXBqdkBfy9jcEX1hZ909UBWceKZuz/5EBrhqlh1L8AQ3ktt0Ibwd9F
ojuc6j6gwVhd1KfSg3zbIbSis6aMLVwZc68gBuU4ifD9t7/YRpshxjGqPF3g4DpyPbru/7s5QEZy
W/tPkqbOo+K1tcpLbpdCWWp1idk51hPwuNQw0LSLKyI97fHJh8yDZHRy2pTKAT6TMlJ9HTeRHzDX
6IMqs56tLmMyM7LZpesXOo3Mpu4ZtNl0ldNgwAw8UHN2BZN5Y8l6hkqS2Wz4ooMCN3dbF5Qvc0LS
rMSxCl8YGpoQ5dXzPLl2mmKzEFKGgDxtgzom3uccuo9VtbXCmkTdaw4iVEssSEXSD0wyHZulynQC
TKI=
=pIOA
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.