int optind = 0, c;
static struct option long_options[] = {
{ .val = 'p', .name = "pid", .has_arg = 1, },
+ { .val = 'P', .name = "process", .has_arg = 1, },
{ .val = 'm', .name = "map", .has_arg = 1, },
{ .val = OPT_WITH_THREADS, .name = "with-threads" },
{ .val = 'h', .name = "help", },
};
- char short_options[] = "p:m:h";
+ char short_options[] = "p:P:m:h";
opts->parse_mask = 0;
while (1) {
opts->pid = atoi(optarg);
opts->parse_mask |= PARSE_PID;
break;
+ case 'P':
+ opts->parse_mask |= PARSE_PROCESS_NAME;
+ opts->name = optarg;
case 'm':
opts->parse_mask |= PARSE_MAP_NAME;
opts->name = optarg;