[Toybox] About blkid -U and -L
Dony Dominic
donydominic2021 at gmail.com
Wed Jul 22 15:15:49 UTC 2026
I am implementing "TODO: -U and -L should require arguments", in
toys/other/blkid.c at line 5.
Currently both -U and -L flags prints all the UUIDs and LABELS of each
devices respectively.
My approach is, which passes "make test_blkid" after rebuild:
1.
USE_BLKID(NEWTOY(blkid, "ULo:s*[!LU]", TOYFLAG_BIN|TOYFLAG_LINEBUF))
to
USE_BLKID(NEWTOY(blkid, "U:L:o:s*[!LU]", TOYFLAG_BIN|TOYFLAG_LINEBUF))
2.
GLOBALS(
struct arg_list *s;
char *o;
)
to
GLOBALS(
struct arg_list *s;
char *o;
char *l;
char *u;
)
and the existing parser logic handles the cases of -U and -L with no
arguments :
$ sudo ./toybox blkid -U
blkid: Missing argument to -U (see "blkid --help")
$ sudo ./toybox blkid -L
blkid: Missing argument to -L (see "blkid --help")
but in the usage comment, the current implementation expects to dump all
UUIDs and LABELs with -U and -L,respectively,with no arguments.
/*
-U Show UUID only (or device with that UUID)
-L Show LABEL only (or device with that LABEL)
*/
I wanted to ask whether this is the right direction? Open to suggestions.
Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox/attachments/20260722/53a96c11/attachment.htm>
More information about the Toybox
mailing list