Merging upstream version 2.11.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 09:07:10 +01:00
parent 666415b758
commit 99896cdeba
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
5 changed files with 29 additions and 13 deletions

View file

@ -240,7 +240,7 @@ static int perf_opt_long_parse(char* optarg)
if ((arg = strchr(optarg, '='))) {
arg++;
optlen = arg - optarg;
optlen = strlen(arg);
if (optlen < 1) {
return -1;
}
@ -305,7 +305,11 @@ void perf_long_opt_usage(void)
fprintf(stderr, "Usage: %s ... -O <name>[=<value>] ...\n\nAvailable long options:\n", progname);
long_opt_t* opt = longopts;
while (opt) {
fprintf(stderr, " %s%s: %s", opt->name, opt->type != perf_opt_boolean ? "=<val>" : "", opt->help);
if (opt->type == perf_opt_boolean) {
fprintf(stderr, " %s: %s", opt->name, opt->help);
} else {
fprintf(stderr, " %s=<%s>: %s", opt->name, opt->desc ? opt->desc : "val", opt->help);
}
if (opt->defval) {
fprintf(stderr, " (default: %s)", opt->defval);
}