]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
losetup: add --output-all option
authorSami Kerola <kerolasa@iki.fi>
Mon, 23 Apr 2018 20:19:35 +0000 (21:19 +0100)
committerSami Kerola <kerolasa@iki.fi>
Thu, 3 May 2018 18:56:20 +0000 (19:56 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
bash-completion/losetup
sys-utils/losetup.8
sys-utils/losetup.c

index b58d8de948cf355bf085a1c9e833456aa4cad061..d20726533eec47d2282f3d92295911575e75682b 100644 (file)
@@ -63,6 +63,7 @@ _losetup_module()
                                --list
                                --noheadings
                                --output
+                               --output-all
                                --raw
                                --help
                                --version"
index cdb9ed05273fa98d1bcb259b7d43d31277dba1f3..a7e38f4f4fc89dfce61a4f45c436eca097b6a328 100644 (file)
@@ -145,6 +145,9 @@ print info about all devices.  See also \fB\-\-output\fP, \fB\-\-noheadings\fP,
 Specify the columns that are to be printed for the \fB\-\-list\fP output.
 Use \fB\-\-help\fR to get a list of all supported columns.
 .TP
+.B \-\-output\-all
+Output all available columns.
+.TP
 .BR \-n , " \-\-noheadings"
 Don't print headings for \fB\-\-list\fP output format.
 .IP "\fB\-\-raw\fP"
index 7c9145a88e154c3e6d9190f85e77cd912c6bcc85..670bce2e393803a8c7fe12956ae8d1d45de8baf9 100644 (file)
@@ -430,6 +430,7 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" -l, --list                    list info about all or specified (default)\n"), out);
        fputs(_(" -n, --noheadings              don't print headings for --list output\n"), out);
        fputs(_(" -O, --output <cols>           specify columns to output for --list\n"), out);
+       fputs(_("     --output-all              output all columns\n"), out);
        fputs(_("     --raw                     use raw --list output format\n"), out);
 
        fputs(USAGE_SEPARATOR, out);
@@ -590,7 +591,8 @@ int main(int argc, char **argv)
                OPT_SIZELIMIT = CHAR_MAX + 1,
                OPT_SHOW,
                OPT_RAW,
-               OPT_DIO
+               OPT_DIO,
+               OPT_OUTPUT_ALL
        };
        static const struct option longopts[] = {
                { "all",          no_argument,       NULL, 'a'           },
@@ -607,6 +609,7 @@ int main(int argc, char **argv)
                { "noheadings",   no_argument,       NULL, 'n'           },
                { "offset",       required_argument, NULL, 'o'           },
                { "output",       required_argument, NULL, 'O'           },
+               { "output-all",   no_argument,       NULL, OPT_OUTPUT_ALL },
                { "sizelimit",    required_argument, NULL, OPT_SIZELIMIT },
                { "partscan",     no_argument,       NULL, 'P'           },
                { "read-only",    no_argument,       NULL, 'r'           },
@@ -701,6 +704,10 @@ int main(int argc, char **argv)
                        outarg = optarg;
                        list = 1;
                        break;
+               case OPT_OUTPUT_ALL:
+                       for (ncolumns = 0; ncolumns < ARRAY_SIZE(infos); ncolumns++)
+                               columns[ncolumns] = ncolumns;
+                       break;
                case 'P':
                        lo_flags |= LO_FLAGS_PARTSCAN;
                        break;