]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
swapon: add --output-all option
authorSami Kerola <kerolasa@iki.fi>
Tue, 24 Apr 2018 20:59:23 +0000 (21:59 +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/swapon
sys-utils/swapon.8
sys-utils/swapon.c

index 4a53ec5acaf774cc993ef2e3172e30269c4a038d..f5136efd3181a8e68574bc9aefe8516dc41ee28f 100644 (file)
@@ -50,6 +50,7 @@ _swapon_module()
                                --priority
                                --summary
                                --show
+                               --output-all
                                --noheadings
                                --raw
                                --bytes
index 3c66c818894942195c6db83b43eb16e794abc2a6..b8fc8be719a3b86cab4ccbeb4901987bedb236e7 100644 (file)
@@ -160,6 +160,9 @@ Display a definable table of swap areas.  See the
 .B \-\-help
 output for a list of available columns.
 .TP
+.B \-\-output\-all
+Output all available columns.
+.TP
 .B \-\-noheadings
 Do not print headings when displaying
 .B \-\-show
index 757601ae6520d5df917da4e541f276088e55ac04..4ef2f1c9da810bec4f25e03d5fbb115678fe03a0 100644 (file)
@@ -846,7 +846,8 @@ int main(int argc, char *argv[])
                BYTES_OPTION = CHAR_MAX + 1,
                NOHEADINGS_OPTION,
                RAW_OPTION,
-               SHOW_OPTION
+               SHOW_OPTION,
+               OPT_LIST_TYPES
        };
 
        static const struct option long_opts[] = {
@@ -861,6 +862,7 @@ int main(int argc, char *argv[])
                { "verbose",    no_argument,       NULL, 'v'               },
                { "version",    no_argument,       NULL, 'V'               },
                { "show",       optional_argument, NULL, SHOW_OPTION       },
+               { "output-all", no_argument,       NULL, OPT_LIST_TYPES    },
                { "noheadings", no_argument,       NULL, NOHEADINGS_OPTION },
                { "raw",        no_argument,       NULL, RAW_OPTION        },
                { "bytes",      no_argument,       NULL, BYTES_OPTION      },
@@ -951,6 +953,10 @@ int main(int argc, char *argv[])
                        }
                        ctl.show = 1;
                        break;
+               case OPT_LIST_TYPES:
+                       for (ctl.ncolumns = 0; (size_t)ctl.ncolumns < ARRAY_SIZE(infos); ctl.ncolumns++)
+                               ctl.columns[ctl.ncolumns] = ctl.ncolumns;
+                       break;
                case NOHEADINGS_OPTION:
                        ctl.no_heading = 1;
                        break;