int r;
argv = strv_skip(argv, 1);
- if (strv_isempty(argv)) {
- if (!sd_id128_is_null(arg_app))
- return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
- "'show --app-specific=' can only be used with explicit UUID input.");
-
- for (const GptPartitionType *e = gpt_partition_type_table; e->name; e++) {
- r = show_one(&table, e->name, e->uuid, e == gpt_partition_type_table);
- if (r < 0)
- return r;
- }
- } else
+ if (argv)
STRV_FOREACH(p, argv) {
sd_id128_t uuid;
const char *id = NULL;
if (r < 0)
return r;
}
+ else {
+ if (!sd_id128_is_null(arg_app))
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "'show --app-specific=' can only be used with explicit UUID input.");
+
+ for (const GptPartitionType *e = gpt_partition_type_table; e->name; e++) {
+ r = show_one(&table, e->name, e->uuid, e == gpt_partition_type_table);
+ if (r < 0)
+ return r;
+ }
+ }
if (table) {
r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, arg_legend);
return r;
patterns = strv_skip(argv, 1);
- if (strv_isempty(patterns)) {
- units = strv_new(SPECIAL_DEFAULT_TARGET);
- if (!units)
- return log_oom();
- } else {
+ if (patterns) {
r = expand_unit_names(bus, patterns, NULL, &units, NULL);
if (r < 0)
return log_error_errno(r, "Failed to expand names: %m");
+ } else {
+ units = strv_new(SPECIAL_DEFAULT_TARGET);
+ if (!units)
+ return log_oom();
}
pager_open(arg_pager_flags);
"%s: expected: load [module…]", argv[0]);
char **modules = strv_skip(argv, 2);
- if (strv_isempty(modules)) {
+ if (modules)
+ STRV_FOREACH(module, modules)
+ (void) module_load_and_warn(ctx, *module, /* verbose = */ false);
+ else {
const char *modalias;
r = sd_device_get_property_value(dev, "MODALIAS", &modalias);
return log_device_warning_errno(dev, r, "Failed to read property \"MODALIAS\": %m");
(void) module_load_and_warn(ctx, modalias, /* verbose = */ false);
- } else
- STRV_FOREACH(module, modules)
- (void) module_load_and_warn(ctx, *module, /* verbose = */ false);
+ }
return 0;
}