Explicitly add '--tree' to the lsblk to remove partitions from top level output

After trimming the lsblk output by listing only required columns (see [1]), the output includes not only the disk devices, but also their partitions, which significantly clutters the device selection dialog.

This happens becuase the "--output" argument [2] defaults to using "--tree", but only if the column "NAME" is outputed, which in current state doesn't (only "kname" is used). So that all child elements (e.g. partitions) are listed on the same level with disk devices.

Thus ist's proposed to explicitly add "--tree" argument, so that we don't
rely on lsblk CLI intricacies

[1] baae3c7641
[2] https://www.mankier.com/8/lsblk#--output
This commit is contained in:
Dmytro Aleksandrov 2024-09-29 14:26:44 -04:00 committed by Tom Dewey
parent 2ec36edd58
commit 701f03ec94

View file

@ -52,6 +52,7 @@ namespace Drivelist
"--bytes", "--bytes",
"--json", "--json",
"--paths", "--paths",
"--tree",
"--output", "kname,type,subsystems,ro,rm,hotplug,size,phy-sec,log-sec,label,vendor,model,mountpoint", "--output", "kname,type,subsystems,ro,rm,hotplug,size,phy-sec,log-sec,label,vendor,model,mountpoint",
"--exclude", "7" "--exclude", "7"
}; };