summaryrefslogtreecommitdiffstats
path: root/sys-utils/rfkill.c
diff options
context:
space:
mode:
authorSami Kerola2018-04-24 22:47:26 +0200
committerSami Kerola2018-05-03 20:56:21 +0200
commit4dfd172dd8e42d060023440cfe5af9ab42b14464 (patch)
tree0163a5354f775c169960c92b6ccbf996a54d43f8 /sys-utils/rfkill.c
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>
Diffstat (limited to 'sys-utils/rfkill.c')
-rw-r--r--sys-utils/rfkill.c12
1 files changed, 11 insertions, 1 deletions
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;