From: Sami Kerola Date: Mon, 23 Apr 2018 20:02:44 +0000 (+0100) Subject: findmnt: add --output-all option X-Git-Tag: v2.33-rc1~274^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00147883de850f909b0c0594fd83a93a002271ac;p=thirdparty%2Futil-linux.git findmnt: add --output-all option Signed-off-by: Sami Kerola --- diff --git a/bash-completion/findmnt b/bash-completion/findmnt index bdfa5de5ce..21167ca300 100644 --- a/bash-completion/findmnt +++ b/bash-completion/findmnt @@ -118,6 +118,7 @@ _findmnt_module() --notruncate --options --output + --output-all --pairs --raw --types diff --git a/misc-utils/findmnt.8 b/misc-utils/findmnt.8 index 58dd38625c..d76d06e9d9 100644 --- a/misc-utils/findmnt.8 +++ b/misc-utils/findmnt.8 @@ -150,6 +150,11 @@ options are not specified. The default list of columns may be extended if \fIlist\fP is specified in the format \fI+list\fP (e.g. \fBfindmnt \-o +PROPAGATION\fP). .TP +.B \-\-output\-all +Output almost all available columns. The columns that require +.B \-\-poll +are not included. +.TP .BR \-P , " \-\-pairs" Use key="value" output format. All potentially unsafe characters are hex-escaped (\\x). .TP diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index 4d55cde33d..c3365534c5 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -1227,6 +1227,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -n, --noheadings don't print column headings\n"), out); fputs(_(" -O, --options limit the set of filesystems by mount options\n"), out); fputs(_(" -o, --output the output columns to be shown\n"), out); + fputs(_(" --output-all output all available columns\n"), out); fputs(_(" -P, --pairs use key=\"value\" output format\n"), out); fputs(_(" -R, --submounts print all submounts for the matching filesystems\n"), out); fputs(_(" -r, --raw use raw output format\n"), out); @@ -1272,7 +1273,8 @@ int main(int argc, char *argv[]) enum { FINDMNT_OPT_VERBOSE = CHAR_MAX + 1, - FINDMNT_OPT_TREE + FINDMNT_OPT_TREE, + FINDMNT_OPT_OUTPUT_ALL }; static const struct option longopts[] = { @@ -1296,6 +1298,7 @@ int main(int argc, char *argv[]) { "notruncate", no_argument, NULL, 'u' }, { "options", required_argument, NULL, 'O' }, { "output", required_argument, NULL, 'o' }, + { "output-all", no_argument, NULL, FINDMNT_OPT_OUTPUT_ALL }, { "poll", optional_argument, NULL, 'p' }, { "pairs", no_argument, NULL, 'P' }, { "raw", no_argument, NULL, 'r' }, @@ -1396,6 +1399,13 @@ int main(int argc, char *argv[]) case 'o': outarg = optarg; break; + case FINDMNT_OPT_OUTPUT_ALL: + for (ncolumns = 0; ncolumns < ARRAY_SIZE(infos); ncolumns++) { + if (is_tabdiff_column(ncolumns)) + continue; + columns[ncolumns] = ncolumns; + } + break; case 'O': set_match(COL_OPTIONS, optarg); break;