diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 52e3416cab..0305f61194 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -557,14 +557,16 @@ static int output_units_list(const UnitInfo *unit_infos, unsigned c) { off = ansi_normal(); } - if (arg_all) + if (arg_all || strv_contains(arg_states, "inactive")) printf("%s%u loaded units listed.%s\n" "To show all installed unit files use 'systemctl list-unit-files'.\n", on, n_shown, off); - else + else if (!arg_states) printf("%s%u loaded units listed.%s Pass --all to see loaded but inactive units, too.\n" "To show all installed unit files use 'systemctl list-unit-files'.\n", on, n_shown, off); + else + printf("%u loaded units listed.\n", n_shown); } return 0;