All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug in lsblk command or man page?
@ 2020-12-24  1:14 David O'Brien
  2021-01-05 10:27 ` Karel Zak
  0 siblings, 1 reply; 5+ messages in thread
From: David O'Brien @ 2020-12-24  1:14 UTC (permalink / raw)
  To: util-linux


[-- Attachment #1.1: Type: text/plain, Size: 1050 bytes --]

I don't know if this is expected or not, but it seems very odd:

# lsblk -o=UUID /stratis/labpool/labfs
lsblk: unknown column: =UUID

[root@serverb ~]# lsblk -o UUID /stratis/labpool/labfs
UUID
0118efb8-66fe-406a-837c-725961bdad4d

[root@serverb ~]# lsblk --output=UUID /stratis/labpool/labfs
UUID
0118efb8-66fe-406a-837c-725961bdad4d


From the man(8) page:
-o, --output list
              Specify which output columns to print.  Use --help to get
              a list of all supported columns.  The columns may affect
              tree-like output.  The default is to use tree for the
              column 'NAME' (see also --tree).

              The default list of columns may be extended if list is
              specified in the format +list (e.g., lsblk -o +UUID).

There is no mention of "=" being required, causing failures, etc. I found this quite frustrating.

I'm on Fedora 32.

Thanks.
-- 
David
Introvert/Unclubbable/Cool

Red Hat's core values are freedom, courage, commitment, and accountability.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug in lsblk command or man page?
  2020-12-24  1:14 Bug in lsblk command or man page? David O'Brien
@ 2021-01-05 10:27 ` Karel Zak
  2021-01-05 14:08   ` David O'Brien
  0 siblings, 1 reply; 5+ messages in thread
From: Karel Zak @ 2021-01-05 10:27 UTC (permalink / raw)
  To: David O'Brien; +Cc: util-linux

On Thu, Dec 24, 2020 at 11:14:04AM +1000, David O'Brien wrote:
> I don't know if this is expected or not, but it seems very odd:
> 
> # lsblk -o=UUID /stratis/labpool/labfs
> lsblk: unknown column: =UUID
> 
> [root@serverb ~]# lsblk -o UUID /stratis/labpool/labfs
> UUID
> 0118efb8-66fe-406a-837c-725961bdad4d
> 
> [root@serverb ~]# lsblk --output=UUID /stratis/labpool/labfs
> UUID
> 0118efb8-66fe-406a-837c-725961bdad4d
> 
> 
> From the man(8) page:
> -o, --output list
>               Specify which output columns to print.  Use --help to get
>               a list of all supported columns.  The columns may affect
>               tree-like output.  The default is to use tree for the
>               column 'NAME' (see also --tree).
> 
>               The default list of columns may be extended if list is
>               specified in the format +list (e.g., lsblk -o +UUID).
> 
> There is no mention of "=" being required, causing failures, etc. I found this quite frustrating.
> 

This is common getopt_long() behavior where equal sign is usable only for
long options (and sometimes for optional arguments).

 lsblk -o UUID
 lsblk --output UUID
 lsblk --output=UUID

this is how "=" works in almost all commands and I don't see reason
why we need to be explicit about it for "lsblk -o".

    Karel

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug in lsblk command or man page?
  2021-01-05 10:27 ` Karel Zak
@ 2021-01-05 14:08   ` David O'Brien
  2021-01-05 17:05     ` Bill Unruh
  0 siblings, 1 reply; 5+ messages in thread
From: David O'Brien @ 2021-01-05 14:08 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux


[-- Attachment #1.1: Type: text/plain, Size: 1710 bytes --]

On 1/5/21 8:27 PM, Karel Zak wrote:
> On Thu, Dec 24, 2020 at 11:14:04AM +1000, David O'Brien wrote:
>> I don't know if this is expected or not, but it seems very odd:
>>
>> # lsblk -o=UUID /stratis/labpool/labfs
>> lsblk: unknown column: =UUID
>>
>> [root@serverb ~]# lsblk -o UUID /stratis/labpool/labfs
>> UUID
>> 0118efb8-66fe-406a-837c-725961bdad4d
>>
>> [root@serverb ~]# lsblk --output=UUID /stratis/labpool/labfs
>> UUID
>> 0118efb8-66fe-406a-837c-725961bdad4d
>>
>>
>> From the man(8) page:
>> -o, --output list
>>               Specify which output columns to print.  Use --help to get
>>               a list of all supported columns.  The columns may affect
>>               tree-like output.  The default is to use tree for the
>>               column 'NAME' (see also --tree).
>>
>>               The default list of columns may be extended if list is
>>               specified in the format +list (e.g., lsblk -o +UUID).
>>
>> There is no mention of "=" being required, causing failures, etc. I found this quite frustrating.
>>
> 
> This is common getopt_long() behavior where equal sign is usable only for
> long options (and sometimes for optional arguments).
> 
>  lsblk -o UUID
>  lsblk --output UUID
>  lsblk --output=UUID
> 
> this is how "=" works in almost all commands and I don't see reason
> why we need to be explicit about it for "lsblk -o".
> 
>     Karel
> 
ok. If it's common and expected that's fine. I don't spend a lot of time with this class/type of command and it was just
new to me and seemed odd.

cheers
-- 
David
Introvert/Unclubbable/Cool

Red Hat's core values are freedom, courage, commitment, and accountability.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug in lsblk command or man page?
  2021-01-05 14:08   ` David O'Brien
@ 2021-01-05 17:05     ` Bill Unruh
  2021-01-06 12:03       ` Karel Zak
  0 siblings, 1 reply; 5+ messages in thread
From: Bill Unruh @ 2021-01-05 17:05 UTC (permalink / raw)
  To: David O'Brien; +Cc: Karel Zak, util-linux

Of course it being "common" does NOT mean that everyone knows the convention,
especially people new to Linux. And is NOT an excuse for the man page being
wrong. So, yes, you should be explicit about it, and not be wrong about it in
the man page.

It is -o list and --output=list

On Wed, 6 Jan 2021, David O'Brien wrote:

> On 1/5/21 8:27 PM, Karel Zak wrote:
>> On Thu, Dec 24, 2020 at 11:14:04AM +1000, David O'Brien wrote:
>>> I don't know if this is expected or not, but it seems very odd:
>>>
>>> # lsblk -o=UUID /stratis/labpool/labfs
>>> lsblk: unknown column: =UUID
>>>
>>> [root@serverb ~]# lsblk -o UUID /stratis/labpool/labfs
>>> UUID
>>> 0118efb8-66fe-406a-837c-725961bdad4d
>>>
>>> [root@serverb ~]# lsblk --output=UUID /stratis/labpool/labfs
>>> UUID
>>> 0118efb8-66fe-406a-837c-725961bdad4d
>>>
>>>
>>> From the man(8) page:
>>> -o, --output list
>>>               Specify which output columns to print.  Use --help to get
>>>               a list of all supported columns.  The columns may affect
>>>               tree-like output.  The default is to use tree for the
>>>               column 'NAME' (see also --tree).
>>>
>>>               The default list of columns may be extended if list is
>>>               specified in the format +list (e.g., lsblk -o +UUID).
>>>
>>> There is no mention of "=" being required, causing failures, etc. I found this quite frustrating.
>>>
>>
>> This is common getopt_long() behavior where equal sign is usable only for
>> long options (and sometimes for optional arguments).
>>
>>  lsblk -o UUID
>>  lsblk --output UUID
>>  lsblk --output=UUID
>>
>> this is how "=" works in almost all commands and I don't see reason
>> why we need to be explicit about it for "lsblk -o".
>>
>>     Karel
>>
> ok. If it's common and expected that's fine. I don't spend a lot of time with this class/type of command and it was just
> new to me and seemed odd.
>
> cheers
> -- 
> David
> Introvert/Unclubbable/Cool
>
> Red Hat's core values are freedom, courage, commitment, and accountability.
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug in lsblk command or man page?
  2021-01-05 17:05     ` Bill Unruh
@ 2021-01-06 12:03       ` Karel Zak
  0 siblings, 0 replies; 5+ messages in thread
From: Karel Zak @ 2021-01-06 12:03 UTC (permalink / raw)
  To: Bill Unruh; +Cc: David O'Brien, util-linux

On Tue, Jan 05, 2021 at 09:05:48AM -0800, Bill Unruh wrote:
> Of course it being "common" does NOT mean that everyone knows the convention,
> especially people new to Linux. And is NOT an excuse for the man page being
> wrong. So, yes, you should be explicit about it, and not be wrong about it in
> the man page.

There is nothing wrong in the man page.

> It is -o list and --output=list

It is "-o list", "--output list" and "--output=list".

And this is valid for 99% options in all our man pages. Not sure if we
want to explicitly describe it in all the pages ... and it's also libc
specific where the command line parser is implemented.

We recommend "=" only for optional arguments (--foo[=<argument>]), and 
on all other paces in the man pages (and in --help outputs) we do not
use "=" at all as it's not required.

So, use "-o list" and "--output list" and forget "=", you do not need it.
That's the message we want to deliver to user by man pages.

    Karel

> On Wed, 6 Jan 2021, David O'Brien wrote:
> 
> > On 1/5/21 8:27 PM, Karel Zak wrote:
> > > On Thu, Dec 24, 2020 at 11:14:04AM +1000, David O'Brien wrote:
> > > > I don't know if this is expected or not, but it seems very odd:
> > > > 
> > > > # lsblk -o=UUID /stratis/labpool/labfs
> > > > lsblk: unknown column: =UUID
> > > > 
> > > > [root@serverb ~]# lsblk -o UUID /stratis/labpool/labfs
> > > > UUID
> > > > 0118efb8-66fe-406a-837c-725961bdad4d
> > > > 
> > > > [root@serverb ~]# lsblk --output=UUID /stratis/labpool/labfs
> > > > UUID
> > > > 0118efb8-66fe-406a-837c-725961bdad4d
> > > > 
> > > > 
> > > > From the man(8) page:
> > > > -o, --output list
> > > >               Specify which output columns to print.  Use --help to get
> > > >               a list of all supported columns.  The columns may affect
> > > >               tree-like output.  The default is to use tree for the
> > > >               column 'NAME' (see also --tree).
> > > > 
> > > >               The default list of columns may be extended if list is
> > > >               specified in the format +list (e.g., lsblk -o +UUID).
> > > > 
> > > > There is no mention of "=" being required, causing failures, etc. I found this quite frustrating.
> > > > 
> > > 
> > > This is common getopt_long() behavior where equal sign is usable only for
> > > long options (and sometimes for optional arguments).
> > > 
> > >  lsblk -o UUID
> > >  lsblk --output UUID
> > >  lsblk --output=UUID
> > > 
> > > this is how "=" works in almost all commands and I don't see reason
> > > why we need to be explicit about it for "lsblk -o".
> > > 
> > >     Karel
> > > 
> > ok. If it's common and expected that's fine. I don't spend a lot of time with this class/type of command and it was just
> > new to me and seemed odd.
> > 
> > cheers
> > -- 
> > David
> > Introvert/Unclubbable/Cool
> > 
> > Red Hat's core values are freedom, courage, commitment, and accountability.
> > 
> > 
> 

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-06 12:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-24  1:14 Bug in lsblk command or man page? David O'Brien
2021-01-05 10:27 ` Karel Zak
2021-01-05 14:08   ` David O'Brien
2021-01-05 17:05     ` Bill Unruh
2021-01-06 12:03       ` Karel Zak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.