split_by_memmap_on_memory : 1,
split_by_config : 1,
have_zones : 1,
- have_memconfig : 1;
+ have_memconfig : 1,
+ annotate_headers : 1;
};
fputs(_("List the ranges of available memory with their online status.\n"), out);
fputs(USAGE_OPTIONS, out);
- fputs(_(" -J, --json use JSON output format\n"), out);
- fputs(_(" -P, --pairs use key=\"value\" output format\n"), out);
- fputs(_(" -a, --all list each individual memory block\n"), out);
- fputs(_(" -b, --bytes print SIZE in bytes rather than in human readable format\n"), out);
- fputs(_(" -n, --noheadings don't print headings\n"), out);
- fputs(_(" -o, --output <list> output columns\n"), out);
- fputs(_(" --output-all output all columns\n"), out);
- fputs(_(" -r, --raw use raw output format\n"), out);
- fputs(_(" -S, --split <list> split ranges by specified columns\n"), out);
- fputs(_(" -s, --sysroot <dir> use the specified directory as system root\n"), out);
- fputs(_(" --summary[=when] print summary information (never,always or only)\n"), out);
+ fputs(_(" -J, --json use JSON output format\n"), out);
+ fputs(_(" -P, --pairs use key=\"value\" output format\n"), out);
+ fputs(_(" -a, --all list each individual memory block\n"), out);
+ fputs(_(" -b, --bytes print SIZE in bytes rather than in human readable format\n"), out);
+ fputs(_(" -n, --noheadings don't print headings\n"), out);
+ fputs(_(" -o, --output <list> output columns\n"), out);
+ fputs(_(" --output-all output all columns\n"), out);
+ fputs(_(" -r, --raw use raw output format\n"), out);
+ fputs(_(" --annotate[=<when>] annotate columns with a tooltip (always|never|auto)\n"), out);
+ fputs(_(" -S, --split <list> split ranges by specified columns\n"), out);
+ fputs(_(" -s, --sysroot <dir> use the specified directory as system root\n"), out);
+ fputs(_(" --summary[=when] print summary information (never,always or only)\n"), out);
fputs(USAGE_SEPARATOR, out);
- fprintf(out, USAGE_HELP_OPTIONS(22));
+ fprintf(out, USAGE_HELP_OPTIONS(27));
fputs(USAGE_COLUMNS, out);
for (i = 0; i < ARRAY_SIZE(coldescs); i++)
.want_summary = 1
}, *lsmem = &_lsmem;
- const char *outarg = NULL, *splitarg = NULL, *prefix = NULL;
+ const char *outarg = NULL, *splitarg = NULL, *prefix = NULL, *annotate_opt_arg = NULL;
int c;
size_t i;
enum {
LSMEM_OPT_SUMARRY = CHAR_MAX + 1,
- OPT_OUTPUT_ALL
+ OPT_OUTPUT_ALL,
+ OPT_ANNOTATE,
};
static const struct option longopts[] = {
{"split", required_argument, NULL, 'S'},
{"version", no_argument, NULL, 'V'},
{"summary", optional_argument, NULL, LSMEM_OPT_SUMARRY },
+ { "annotate", optional_argument, NULL, OPT_ANNOTATE },
{NULL, 0, NULL, 0}
};
static const ul_excl_t excl[] = { /* rows and cols in ASCII order */
} else
lsmem->want_table = 0;
break;
-
+ case OPT_ANNOTATE:
+ annotate_opt_arg = optarg;
+ break;
case 'h':
usage();
case 'V':
errtryhelp(EXIT_FAILURE);
}
+ if (annotationwanted(annotate_opt_arg))
+ lsmem->annotate_headers = 1;
+
if (lsmem->want_table + lsmem->want_summary == 0)
errx(EXIT_FAILURE, _("options --{raw,json,pairs} and --summary=only are mutually exclusive"));
break;
}
}
+
+ if (lsmem->annotate_headers && ci->help)
+ scols_column_refer_annotation(cl, ci->help);
}
if (splitarg) {