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

index 2d561e955d0a305b5a032cb47aba24915816b6a9..4643666e29fff000fa314b270226498d1823c236 100644 (file)
@@ -36,6 +36,7 @@ _rfkill_module()
                --json
                --noheadings
                --output
+               --output-all
                --raw
                --help
                --version
index 3c30c8cedc9a44557ed340eda7928c27f40a434e..9eff913b8adba8730b4776661a66f8f1c2b22f74 100644 (file)
@@ -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
index 57e1dddab02702956833144b5d0f7ce4fca23082..d87815a25846ef56e43840a87488981cdc2625d1 100644 (file)
@@ -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;