From ba1c9075f4525ef27bcfe98dfeca95b749276a9e Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Tue, 24 Apr 2018 21:32:42 +0100 Subject: partx: add --output-all option Signed-off-by: Sami Kerola --- disk-utils/partx.8 | 3 +++ disk-utils/partx.c | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'disk-utils') diff --git a/disk-utils/partx.8 b/disk-utils/partx.8 index af7313cb9..7794f41c9 100644 --- a/disk-utils/partx.8 +++ b/disk-utils/partx.8 @@ -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 diff --git a/disk-utils/partx.c b/disk-utils/partx.c index 43a6448db..3ccd1afad 100644 --- a/disk-utils/partx.c +++ b/disk-utils/partx.c @@ -765,6 +765,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -g, --noheadings don't print headings for --show\n"), out); fputs(_(" -n, --nr specify the range of partitions (e.g. --nr 2:4)\n"), out); fputs(_(" -o, --output 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 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; -- cgit v1.2.3-55-g7522