diff --git a/src/portable/portablectl.c b/src/portable/portablectl.c index 04a261297c..4051875b76 100644 --- a/src/portable/portablectl.c +++ b/src/portable/portablectl.c @@ -884,14 +884,14 @@ static int parse_argv(int argc, char *argv[]) { break; case 'p': + if (streq(optarg, "help")) + return dump_profiles(); + if (!filename_is_valid(optarg)) { log_error("Unit profile name not valid: %s", optarg); return -EINVAL; } - if (streq(optarg, "help")) - return dump_profiles(); - arg_profile = optarg; break;