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

index 2368336edd9cd62c0d269d1e89df23f05bfda06a..028146b0ffa000e47bccdcc0590f722df22d3e3f 100644 (file)
@@ -45,6 +45,7 @@ _partx_module()
                                --noheadings
                                --nr
                                --output
+                               --output-all
                                --pairs
                                --raw
                                --sector-size
index af7313cb90cafc553f4360fbcb162654fd467f3a..7794f41c90652e5b12dc892f16132934fc2ceb07 100644 (file)
@@ -106,6 +106,9 @@ or
 .B \-\-list
 options.
 .TP
+.B \-\-output\-all
+Output all available columns.
+.TP
 .BR \-P , " \-\-pairs"
 List the partitions using the KEY="value" format.
 .TP
index 43a6448dbb4b81216e66f0eb463918868662c6a5..3ccd1afadc0e49c3c57124c37f44dd1576cbe59b 100644 (file)
@@ -765,6 +765,7 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" -g, --noheadings     don't print headings for --show\n"), out);
        fputs(_(" -n, --nr <n:m>       specify the range of partitions (e.g. --nr 2:4)\n"), out);
        fputs(_(" -o, --output <list>  define which output columns to use\n"), out);
+       fputs(_("     --output-all     output all columns\n"), out);
        fputs(_(" -P, --pairs          use key=\"value\" output format\n"), out);
        fputs(_(" -r, --raw            use raw output format\n"), out);
        fputs(_(" -S, --sector-size <num>  overwrite sector size\n"), out);
@@ -796,7 +797,8 @@ int main(int argc, char **argv)
        unsigned int sector_size = 0;
 
        enum {
-               OPT_LIST_TYPES = CHAR_MAX + 1
+               OPT_LIST_TYPES = CHAR_MAX + 1,
+               OPT_OUTPUT_ALL
        };
        static const struct option long_opts[] = {
                { "bytes",      no_argument,       NULL, 'b' },
@@ -811,6 +813,7 @@ int main(int argc, char **argv)
                { "list-types", no_argument,       NULL, OPT_LIST_TYPES },
                { "nr",         required_argument, NULL, 'n' },
                { "output",     required_argument, NULL, 'o' },
+               { "output-all", no_argument,       NULL, OPT_OUTPUT_ALL },
                { "pairs",      no_argument,       NULL, 'P' },
                { "sector-size",required_argument, NULL, 'S' },
                { "help",       no_argument,       NULL, 'h' },
@@ -858,6 +861,10 @@ int main(int argc, char **argv)
                case 'o':
                        outarg = optarg;
                        break;
+               case OPT_OUTPUT_ALL:
+                       for (ncolumns = 0; ncolumns < ARRAY_SIZE(infos); ncolumns++)
+                               columns[ncolumns] = ncolumns;
+                       break;
                case 'P':
                        scols_flags |= PARTX_EXPORT;
                        what = ACT_SHOW;