Skip to content
Commit 8027aa39 authored by Alan Jenkins's avatar Alan Jenkins Committed by Zbigniew Jędrzejewski-Szmek
Browse files

systemctl: do not suggest passing --all if the user passed --state=

"systemctl --failed" suggested I pass "--all" to see units in the inactive
state as well.  I thought this was not very useful.  If you explicitly
asked for units in a specific state, then you already know you have
narrowed it down.  And if you ran "systemctl --state=inactive", it is even
more strange to see this message.

@keszybz suggests we probably don't want to suggest "list-unit-files"
either :-).  Let's only suggest that if the user passed "--state=inactive".

Finally, this means the output for "systemctl --failed" could be just
"0 loaded units listed".  In this case, we don't need any highlight on that
text, to distinguish it from the hint.  This matches "list-unit-files".
This also means we happen to avoid using red highlight, when there are zero
failed units, as if that itself was a failure.  @kesbyz pointed out that
old behaviour was a bit weird.

(cherry picked from commit 8eb0cafe)
(cherry picked from commit 3c9f43eb)
(cherry picked from commit 460db2b7)
parent 6078a35e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment