summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Kerola2018-04-24 22:47:26 +0200
committerSami Kerola2018-05-03 20:56:21 +0200
commit4dfd172dd8e42d060023440cfe5af9ab42b14464 (patch)
tree0163a5354f775c169960c92b6ccbf996a54d43f8
parentpartx: add --output-all option (diff)
downloadkernel-qcow2-util-linux-4dfd172dd8e42d060023440cfe5af9ab42b14464.tar.gz
kernel-qcow2-util-linux-4dfd172dd8e42d060023440cfe5af9ab42b14464.tar.xz
kernel-qcow2-util-linux-4dfd172dd8e42d060023440cfe5af9ab42b14464.zip
rfkill: add --output-all option
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r--bash-completion/rfkill1
-rw-r--r--sys-utils/rfkill.83
-rw-r--r--sys-utils/rfkill.c12
3 files changed, 15 insertions, 1 deletions
diff --git a/bash-completion/rfkill b/bash-completion/rfkill
index 2d561e955..4643666e2 100644
--- a/bash-completion/rfkill
+++ b/bash-completion/rfkill
@@ -36,6 +36,7 @@ _rfkill_module()
--json
--noheadings
--output
+ --output-all
--raw
--help
--version
diff --git a/sys-utils/rfkill.8 b/sys-utils/rfkill.8
index 3c30c8ced..9eff913b8 100644
--- a/sys-utils/rfkill.8
+++ b/sys-utils/rfkill.8
@@ -34,6 +34,9 @@ Do not print a header line.
Specify which output columns to print. Use \-\-help to get a list of
available columns.
.TP
+.B \-\-output\-all
+Output all available columns.
+.TP
\fB\-r\fR, \fB\-\-raw\fR
Use the raw output format.
.TP
diff --git a/sys-utils/rfkill.c b/sys-utils/rfkill.c
index 57e1dddab..d87815a25 100644
--- a/sys-utils/rfkill.c
+++ b/sys-utils/rfkill.c
@@ -579,6 +579,7 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_(" -J, --json use JSON output format\n"), stdout);
fputs(_(" -n, --noheadings don't print headings\n"), stdout);
fputs(_(" -o, --output <list> define which output columns to use\n"), stdout);
+ fputs(_(" --output-all output all columns\n"), stdout);
fputs(_(" -r, --raw use the raw output format\n"), stdout);
fputs(USAGE_SEPARATOR, stdout);
@@ -609,12 +610,16 @@ static void __attribute__((__noreturn__)) usage(void)
int main(int argc, char **argv)
{
struct control ctrl = { 0 };
- int c, act = ACT_LIST;
+ int c, act = ACT_LIST, list_all = 0;
char *outarg = NULL;
+ enum {
+ OPT_LIST_TYPES = CHAR_MAX + 1
+ };
static const struct option longopts[] = {
{ "json", no_argument, NULL, 'J' },
{ "noheadings", no_argument, NULL, 'n' },
{ "output", required_argument, NULL, 'o' },
+ { "output-all", no_argument, NULL, OPT_LIST_TYPES },
{ "raw", no_argument, NULL, 'r' },
{ "version", no_argument, NULL, 'V' },
{ "help", no_argument, NULL, 'h' },
@@ -644,6 +649,9 @@ int main(int argc, char **argv)
case 'o':
outarg = optarg;
break;
+ case OPT_LIST_TYPES:
+ list_all = 1;
+ break;
case 'r':
ctrl.raw = 1;
break;
@@ -690,6 +698,8 @@ int main(int argc, char **argv)
columns[ncolumns++] = COL_ID;
columns[ncolumns++] = COL_TYPE;
columns[ncolumns++] = COL_DEVICE;
+ if (list_all)
+ columns[ncolumns++] = COL_DESC;
columns[ncolumns++] = COL_SOFT;
columns[ncolumns++] = COL_HARD;