chiark / gitweb /
systemctl: obey --state in list-unit-files
[elogind.git] / src / systemctl / systemctl.c
index b71040be40f6847bbf7f086f4c4e5ca9b4ea86a9..8481a9b20cb3b52ab489a8c652b1e4ea66abe6a5 100644 (file)
@@ -1268,6 +1268,11 @@ next:
                         return false;
         }
 
+        if (!strv_isempty(arg_states)) {
+                if (!strv_find(arg_states, unit_file_state_to_string(u->state)))
+                        return false;
+        }
+
         return true;
 }