- } else if (starts_with(argv[i], "--query=")) {
- ctx.qry.raw = xstrdup(argv[i] + 8);
- } else if (starts_with(argv[i], "--repo=")) {
- ctx.qry.repo = xstrdup(argv[i] + 7);
- } else if (starts_with(argv[i], "--page=")) {
- ctx.qry.page = xstrdup(argv[i] + 7);
- } else if (starts_with(argv[i], "--head=")) {
- ctx.qry.head = xstrdup(argv[i] + 7);
+ } else if (skip_prefix(argv[i], "--query=", &arg)) {
+ ctx.qry.raw = xstrdup(arg);
+ } else if (skip_prefix(argv[i], "--repo=", &arg)) {
+ ctx.qry.repo = xstrdup(arg);
+ } else if (skip_prefix(argv[i], "--page=", &arg)) {
+ ctx.qry.page = xstrdup(arg);
+ } else if (skip_prefix(argv[i], "--head=", &arg)) {
+ ctx.qry.head = xstrdup(arg);