summaryrefslogtreecommitdiffstats
path: root/sys-utils/lscpu.c
diff options
context:
space:
mode:
authorKarel Zak2019-03-19 16:47:55 +0100
committerKarel Zak2019-03-19 16:47:55 +0100
commit0a31a242cbed77f33c007a4fe66b7c54986a1cd2 (patch)
tree59c7de32ea0c22191d80db7b128d9eae3b51a247 /sys-utils/lscpu.c
parentlscpu: define libsmartcols flags for -e (diff)
downloadkernel-qcow2-util-linux-0a31a242cbed77f33c007a4fe66b7c54986a1cd2.tar.gz
kernel-qcow2-util-linux-0a31a242cbed77f33c007a4fe66b7c54986a1cd2.tar.xz
kernel-qcow2-util-linux-0a31a242cbed77f33c007a4fe66b7c54986a1cd2.zip
lscpu: fix and document --output-all
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/lscpu.c')
-rw-r--r--sys-utils/lscpu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index cea7f01bb..b1b980088 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -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) {