chiark / gitweb /
systemctl: obey --state in list-unit-files
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 30 Oct 2014 02:51:00 +0000 (22:51 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 30 Oct 2014 03:48:10 +0000 (23:48 -0400)
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;
 }