summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Kerola2018-04-23 22:02:44 +0200
committerSami Kerola2018-05-03 20:56:20 +0200
commit00147883de850f909b0c0594fd83a93a002271ac (patch)
treeb743971502fe767957a7c53aa8f59469e130d582
parentdmesg: link together with syslog(2) manual page (diff)
downloadkernel-qcow2-util-linux-00147883de850f909b0c0594fd83a93a002271ac.tar.gz
kernel-qcow2-util-linux-00147883de850f909b0c0594fd83a93a002271ac.tar.xz
kernel-qcow2-util-linux-00147883de850f909b0c0594fd83a93a002271ac.zip
findmnt: add --output-all option
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r--bash-completion/findmnt1
-rw-r--r--misc-utils/findmnt.85
-rw-r--r--misc-utils/findmnt.c12
3 files changed, 17 insertions, 1 deletions
diff --git a/bash-completion/findmnt b/bash-completion/findmnt
index bdfa5de5c..21167ca30 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 58dd38625..d76d06e9d 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<code>).
.TP
diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c
index 4d55cde33..c3365534c 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 <list> limit the set of filesystems by mount options\n"), out);
fputs(_(" -o, --output <list> 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;