This provides alternate ways of specifying output columns similar
to the '--parse', '--extended' and '--caches' options.
Addresses: #2816
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
if (hierarchic == -1)
hierarchic = isatty(STDOUT_FILENO); /* default */
+ if (!outarg && (cxt->mode == LSCPU_OUTPUT_CACHES))
+ outarg = getenv("LSCPU_CACHES_COLUMNS");
+ if (!outarg && ((cxt->mode == LSCPU_OUTPUT_PARSABLE) || (cxt->mode == LSCPU_OUTPUT_READABLE)))
+ outarg = getenv("LSCPU_COLUMNS");
+
switch(cxt->mode) {
case LSCPU_OUTPUT_SUMMARY:
print_summary(cxt);