mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 16:37:19 +09:00
sysusers,tmpfiles: clarify error message for --replace
I was trying to run sysusers --replace, but the input file didn't have the right suffix, and the message was very confusing. Let's split the message in two to make it clearer that we care about the extension.
This commit is contained in:
@@ -2140,10 +2140,12 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
break;
|
||||
|
||||
case ARG_REPLACE:
|
||||
if (!path_is_absolute(optarg) ||
|
||||
!endswith(optarg, ".conf"))
|
||||
if (!path_is_absolute(optarg))
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"The argument to --replace= must an absolute path to a config file");
|
||||
"The argument to --replace= must be an absolute path.");
|
||||
if (!endswith(optarg, ".conf"))
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"The argument to --replace= must have the extension '.conf'.");
|
||||
|
||||
arg_replace = optarg;
|
||||
break;
|
||||
|
||||
@@ -4167,10 +4167,12 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
break;
|
||||
|
||||
case ARG_REPLACE:
|
||||
if (!path_is_absolute(optarg) ||
|
||||
!endswith(optarg, ".conf"))
|
||||
if (!path_is_absolute(optarg))
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"The argument to --replace= must an absolute path to a config file");
|
||||
"The argument to --replace= must be an absolute path.");
|
||||
if (!endswith(optarg, ".conf"))
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||
"The argument to --replace= must have the extension '.conf'.");
|
||||
|
||||
arg_replace = optarg;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user