This doesn't really change anything, but feels nicer, since it abstracts
away what device_action_from_string()/device_action_to_string() do
internally, and always uses a normalized action string (yes, there's no
ambiguity, but it's nice to stay abstract, maybe one day there is
ambiguity around this)
a = device_action_from_string(optarg);
if (a < 0)
- return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
- "Invalid action '%s'", optarg);
+ return log_error_errno(a, "Invalid action '%s'", optarg);
- arg_action = optarg;
+ arg_action = device_action_to_string(a);
break;
}
case 'N':
if (a < 0)
return log_error_errno(a, "Unknown action '%s'", optarg);
- action = optarg;
+ action = device_action_to_string(a);
break;
}
case 's':