err(EXIT_FAILURE, _("failed to allocate output column"));
if (cxt->json)
scols_column_set_json_type(cl, cd->json_type);
+ if (cxt->annotate_col_headers && cd->help)
+ scols_column_refer_annotation(cl, cd->help);
}
/* standard caches */
err(EXIT_FAILURE, _("failed to allocate output column"));
if (cxt->json)
scols_column_set_json_type(cl, cd->json_type);
+ if (cxt->annotate_col_headers && cd->help)
+ scols_column_refer_annotation(cl, cd->help);
}
for (i = 0; i < cxt->npossibles; i++) {
fputs(_(" -r, --raw use raw output format (for -e, -p and -C)\n"), out);
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(_(" --annotate[=<when>] annotate columns with a tooltip (always|never|auto)\n"), out);
fputs(_(" -y, --physical print physical instead of logical IDs\n"), out);
fputs(_(" --hierarchic[=when] use subsections in summary (auto, never, always)\n"), out);
fputs(_(" --output-all print all available columns for -e, -p or -C\n"), out);
int cpu_modifier_specified = 0;
char *outarg = NULL;
size_t i, ncolumns = 0;
+ char *annotate_opt_arg = NULL;
+
enum {
OPT_OUTPUT_ALL = CHAR_MAX + 1,
OPT_HIERARCHIC,
+ OPT_ANNOTATE,
};
static const struct option longopts[] = {
{ "all", no_argument, NULL, 'a' },
{ "sysroot", required_argument, NULL, 's' },
{ "physical", no_argument, NULL, 'y' },
{ "hex", no_argument, NULL, 'x' },
+ { "annotate", optional_argument, NULL, OPT_ANNOTATE },
{ "version", no_argument, NULL, 'V' },
{ "output-all", no_argument, NULL, OPT_OUTPUT_ALL },
{ "hierarchic", optional_argument, NULL, OPT_HIERARCHIC },
case OPT_OUTPUT_ALL:
all = 1;
break;
+ case OPT_ANNOTATE:
+ annotate_opt_arg = optarg;
+ break;
case OPT_HIERARCHIC:
if (optarg) {
if (strcmp(optarg, "auto") == 0)
}
}
+ if (annotationwanted(annotate_opt_arg))
+ cxt->annotate_col_headers = true;
+
if (collist)
list_columns(cxt);