From: Sami Kerola Date: Mon, 23 Apr 2018 20:19:35 +0000 (+0100) Subject: losetup: add --output-all option X-Git-Tag: v2.33-rc1~274^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=289673b1c02374d4f7ae80bb1dd17aabd37d6b14;p=thirdparty%2Futil-linux.git losetup: add --output-all option Signed-off-by: Sami Kerola --- diff --git a/bash-completion/losetup b/bash-completion/losetup index b58d8de948..d20726533e 100644 --- a/bash-completion/losetup +++ b/bash-completion/losetup @@ -63,6 +63,7 @@ _losetup_module() --list --noheadings --output + --output-all --raw --help --version" diff --git a/sys-utils/losetup.8 b/sys-utils/losetup.8 index cdb9ed0527..a7e38f4f4f 100644 --- a/sys-utils/losetup.8 +++ b/sys-utils/losetup.8 @@ -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" diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c index 7c9145a88e..670bce2e39 100644 --- a/sys-utils/losetup.c +++ b/sys-utils/losetup.c @@ -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 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;