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

index bdfa5de5ce4ffc2804587c8c97db2599ee5cb77d..21167ca3005203da39ceceb91081b3b4a7756ed3 100644 (file)
@@ -118,6 +118,7 @@ _findmnt_module()
                                --notruncate
                                --options
                                --output
+                               --output-all
                                --pairs
                                --raw
                                --types
index 58dd38625c38c3d7fdde5bccb23af9e43eca97f1..d76d06e9d9708dcb747757742d0a09d9ee4e4e75 100644 (file)
@@ -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
index 4d55cde33d2f1314d2b29497774e54f2ee9a85db..c3365534c517528d828d10fe8b50771923c43da7 100644 (file)
@@ -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;