]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: fix and document --output-all
authorKarel Zak <kzak@redhat.com>
Tue, 19 Mar 2019 15:47:55 +0000 (16:47 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 19 Mar 2019 15:47:55 +0000 (16:47 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lscpu.c

index cea7f01bbde76c538dd1128d6a7541fe61147774..b1b980088b5d8ba0d61c426a24eb2f27c39df2d0 100644 (file)
@@ -2116,6 +2116,7 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" -s, --sysroot <dir>     use specified directory as system root\n"), out);
        fputs(_(" -x, --hex               print hexadecimal masks rather than lists of CPUs\n"), out);
        fputs(_(" -y, --physical          print physical instead of logical IDs\n"), out);
+       fputs(_("     --output-all        print all available columns for -e, -p or -C\n"), out);
        fputs(USAGE_SEPARATOR, out);
        printf(USAGE_HELP_OPTIONS(25));
 
@@ -2245,13 +2246,13 @@ int main(int argc, char *argv[])
                }
        }
 
-       if (all) {
+       if (all && ncolumns == 0) {
                size_t sz, maxsz = mod->mode == OUTPUT_CACHES ?
                                ARRAY_SIZE(coldescs_cache) :
                                ARRAY_SIZE(coldescs_cpu);
 
                for (sz = 0; sz < maxsz; sz++)
-                       columns[sz] = 1;
+                       columns[ncolumns++] = sz;
        }
 
        if (cpu_modifier_specified && mod->mode == OUTPUT_SUMMARY) {