Skip to contentSkip to conversation

Bug in lsblk command or man page?

DISCUSSION David O'Brien 3 participants 5 messages Dec 24, 2020 – Jan 6, 2021 Util-Linux package

lore
Share & tools
lore
#0 lore raw

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.

Signature · 4 lines
David
Introvert/Unclubbable/Cool

Red Hat's core values are freedom, courage, commitment, and accountability.
maintainer
#1 lore raw
Quoted 21 lines · David O'Brien

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).

Quoted 5 lines

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

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#2 lore raw
Quoted 31 lines · Karel Zak
Quoted 21 lines · David O'Brien

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).

Quoted 5 lines

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).

Quoted 9 lines

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

Signature · 4 lines
David
Introvert/Unclubbable/Cool

Red Hat's core values are freedom, courage, commitment, and accountability.
#3 lore raw

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

Quoted 52 lines · David O'Brien
Quoted 31 lines · Karel Zak
Quoted 21 lines · David O'Brien

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).

Quoted 5 lines

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).

Quoted 9 lines

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

Signature · 4 lines
David
Introvert/Unclubbable/Cool

Red Hat's core values are freedom, courage, commitment, and accountability.
maintainer
#4 lore raw
Quoted 4 lines · Bill Unruh

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.

Quoted 1 line

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

Quoted 55 lines · David O'Brien
Quoted 53 lines · Karel Zak
Quoted 31 lines · David O'Brien
Quoted 21 lines

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).

Quoted 5 lines

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).

Quoted 9 lines

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

Signature · 4 lines
David
Introvert/Unclubbable/Cool

Red Hat's core values are freedom, courage, commitment, and accountability.
Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com