summaryrefslogtreecommitdiffstats
path: root/misc-utils
diff options
context:
space:
mode:
authorKarel Zak2018-05-10 12:15:32 +0200
committerKarel Zak2018-05-10 12:15:32 +0200
commitc9fdebcf540147fe3108971fc9c80d505867f711 (patch)
tree41c8567518c27e21cb371af95518a12140778469 /misc-utils
parentMerge branch 'fixes' of https://github.com/yontalcar/util-linux (diff)
parentzramctl: add --output-all option (diff)
downloadkernel-qcow2-util-linux-c9fdebcf540147fe3108971fc9c80d505867f711.tar.gz
kernel-qcow2-util-linux-c9fdebcf540147fe3108971fc9c80d505867f711.tar.xz
kernel-qcow2-util-linux-c9fdebcf540147fe3108971fc9c80d505867f711.zip
Merge branch 'output-all' of https://github.com/kerolasa/lelux-utiliteetit
* 'output-all' of https://github.com/kerolasa/lelux-utiliteetit: zramctl: add --output-all option swapon: add --output-all option rfkill: add --output-all option partx: add --output-all option lsns: add --output-all option lsmem: add --output-all option lslogins: add --output-all option lslocks: add --output-all option lscpu: add --output-all option losetup: add --output-all option findmnt: add --output-all option
Diffstat (limited to 'misc-utils')
-rw-r--r--misc-utils/findmnt.85
-rw-r--r--misc-utils/findmnt.c12
-rw-r--r--misc-utils/lslocks.83
-rw-r--r--misc-utils/lslocks.c9
4 files changed, 28 insertions, 1 deletions
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;
diff --git a/misc-utils/lslocks.8 b/misc-utils/lslocks.8
index ba0f44752..40b2cebf6 100644
--- a/misc-utils/lslocks.8
+++ b/misc-utils/lslocks.8
@@ -40,6 +40,9 @@ to get a list of all supported columns.
The default list of columns may be extended if \fIlist\fP is
specified in the format \fI+list\fP (e.g. \fBlslocks -o +BLOCKER\fP).
.TP
+.B \-\-output\-all
+Output all available columns.
+.TP
.BR \-p , " \-\-pid " \fIpid\fP
Display only the locks held by the process with this \fIpid\fR.
.TP
diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c
index 2427006f6..f83fb76f2 100644
--- a/misc-utils/lslocks.c
+++ b/misc-utils/lslocks.c
@@ -536,6 +536,7 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_(" -i, --noinaccessible ignore locks without read permissions\n"), out);
fputs(_(" -n, --noheadings don't print headings\n"), out);
fputs(_(" -o, --output <list> define which output columns to use\n"), out);
+ fputs(_(" --output-all output all columns\n"), out);
fputs(_(" -p, --pid <pid> display only locks held by this process\n"), out);
fputs(_(" -r, --raw use the raw output format\n"), out);
fputs(_(" -u, --notruncate don't truncate text in columns\n"), out);
@@ -558,12 +559,16 @@ int main(int argc, char *argv[])
int c, rc = 0;
struct list_head locks;
char *outarg = NULL;
+ enum {
+ OPT_OUTPUT_ALL = CHAR_MAX + 1
+ };
static const struct option long_opts[] = {
{ "bytes", no_argument, NULL, 'b' },
{ "json", no_argument, NULL, 'J' },
{ "pid", required_argument, NULL, 'p' },
{ "help", no_argument, NULL, 'h' },
{ "output", required_argument, NULL, 'o' },
+ { "output-all", no_argument, NULL, OPT_OUTPUT_ALL },
{ "notruncate", no_argument, NULL, 'u' },
{ "version", no_argument, NULL, 'V' },
{ "noheadings", no_argument, NULL, 'n' },
@@ -603,6 +608,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 'V':
printf(UTIL_LINUX_VERSION);
return EXIT_SUCCESS;