summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2016-03-23 07:47:00 +0100
committerFranck Bui <fbui@suse.com>2016-03-23 08:36:05 +0100
commitebc962656cee33e3e8395f456a8208c3ca41969c (patch)
treee168d612855e5a9970a31318cebf7bc1cc8d5a09
parentc41d3b3a0ca1c53cbf05563f00bcef72db58d9b0 (diff)
downloadsystemd-ebc962656cee33e3e8395f456a8208c3ca41969c.tar.gz
systemctl: no need to pass --all if inactive is explicitly requested in list-units
If list-units command is explicitly asked to show inactive units by using '--state=inactive' option, there's no need to force the user to pass '--all' option to include inactive units in the search in this case.
-rw-r--r--src/systemctl/systemctl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 180c8f9656..2afb7bad1a 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -340,6 +340,11 @@ static bool output_show_unit(const UnitInfo *u, char **patterns) {
if (arg_all)
return true;
+ if (!strv_isempty(arg_states))
+ return true;
+
+ /* By default show all units except the ones in inactive
+ * state and with no pending job */
if (u->job_id > 0)
return true;