case ARG_VERSION:
return version();
- case 't': {
- const char *p;
-
+ case 't':
if (isempty(optarg))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"--type= requires arguments.");
- for (p = optarg;;) {
+ for (const char *p = optarg;;) {
_cleanup_free_ char *type = NULL;
r = extract_first_word(&p, &type, ",", 0);
}
break;
- }
case 'P':
arg_value = true;
arg_properties = new0(char*, 1);
if (!arg_properties)
return log_oom();
- } else {
- const char *p;
-
- for (p = optarg;;) {
+ } else
+ for (const char *p = optarg;;) {
_cleanup_free_ char *prop = NULL;
r = extract_first_word(&p, &prop, ",", 0);
if (strv_consume(&arg_properties, TAKE_PTR(prop)) < 0)
return log_oom();
}
- }
/* If the user asked for a particular property, show it, even if it is empty. */
arg_all = true;
arg_boot_loader_entry = empty_to_null(optarg);
break;
- case ARG_STATE: {
- const char *p;
-
+ case ARG_STATE:
if (isempty(optarg))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"--state= requires arguments.");
- for (p = optarg;;) {
+ for (const char *p = optarg;;) {
_cleanup_free_ char *s = NULL;
r = extract_first_word(&p, &s, ",", 0);
return log_oom();
}
break;
- }
case 'r':
if (geteuid() != 0)
arg_with_dependencies = true;
break;
- case ARG_WHAT: {
- const char *p;
-
+ case ARG_WHAT:
if (isempty(optarg))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "--what= requires arguments.");
- for (p = optarg;;) {
+ for (const char *p = optarg;;) {
_cleanup_free_ char *k = NULL;
r = extract_first_word(&p, &k, ",", 0);
}
break;
- }
case ARG_REBOOT_ARG:
arg_reboot_argument = optarg;