- if (argc > idx_metric_rmap) {
- if (strmatch(argv[idx_metric_rmap]->text, "metric"))
- metric = strtoul(argv[idx_metric_rmap + 1]->arg, NULL,
- 10);
- else
- routemap = argv[idx_metric_rmap + 1]->arg;
+ if (argv_find(argv, argc, "metric", &idx_metric_rmap)) {
+ metric = strtoul(argv[idx_metric_rmap + 1]->arg, NULL, 10);
+ }
+
+ idx_metric_rmap = 1;
+ if (argv_find(argv, argc, "route-map", &idx_metric_rmap)) {
+ routemap = argv[idx_metric_rmap + 1]->arg;