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

index 69337acef315ec2e25dc5ff391ed62c7fe50aa0a..4d3582fd47c839cf66bf12c2346fe414014aaba3 100644 (file)
@@ -37,6 +37,7 @@ _lscpu_module()
                                --sysroot
                                --hex
                                --physical
+                               --output-all
                                --help
                                --version"
                        COMPREPLY=( $(compgen -W "${OPTS_ALL[*]}" -- $cur) )
index b70f2e151c7ec3861b24c5ca81beffcc986710ba..fa7a475ba11b5abd5e668c24b644386b87dda335 100644 (file)
@@ -161,6 +161,10 @@ The CPU logical numbers are not affected by this option.
 .TP
 .BR \-V , " \-\-version"
 Display version information and exit.
+.TP
+.B \-\-output\-all
+Output all available columns.  This option must be combined with either
+.BR \-\-extended " or " \-\-parse .
 .SH BUGS
 The basic overview of CPU family, model, etc. is always based on the first
 CPU only.
index 2132511a5a8555088197033e867b82e1c18b4191..f260fe7cafe6a81b62a53df08effc1793b7ce8f6 100644 (file)
@@ -1932,6 +1932,9 @@ int main(int argc, char *argv[])
        int columns[ARRAY_SIZE(coldescs)], ncolumns = 0;
        int cpu_modifier_specified = 0;
 
+       enum {
+               OPT_OUTPUT_ALL = CHAR_MAX + 1,
+       };
        static const struct option longopts[] = {
                { "all",        no_argument,       NULL, 'a' },
                { "online",     no_argument,       NULL, 'b' },
@@ -1944,6 +1947,7 @@ int main(int argc, char *argv[])
                { "physical",   no_argument,       NULL, 'y' },
                { "hex",        no_argument,       NULL, 'x' },
                { "version",    no_argument,       NULL, 'V' },
+               { "output-all", no_argument,       NULL, OPT_OUTPUT_ALL },
                { NULL,         0, NULL, 0 }
        };
 
@@ -2008,6 +2012,13 @@ int main(int argc, char *argv[])
                case 'V':
                        printf(UTIL_LINUX_VERSION);
                        return EXIT_SUCCESS;
+               case OPT_OUTPUT_ALL:
+               {
+                       size_t sz;
+                       for (sz = 0; sz < ARRAY_SIZE(coldescs); sz++)
+                               columns[sz] = 1;
+                       break;
+               }
                default:
                        errtryhelp(EXIT_FAILURE);
                }