mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-05 21:21:49 +00:00
systemctl: obey --state in list-unit-files
(cherry picked from commit fec1530e6b)
Conflicts:
src/systemctl/systemctl.c
This commit is contained in:
@@ -777,6 +777,11 @@ static int compare_unit_file_list(const void *a, const void *b) {
|
||||
static bool output_show_unit_file(const UnitFileList *u) {
|
||||
const char *dot;
|
||||
|
||||
if (!strv_isempty(arg_states)) {
|
||||
if (!strv_find(arg_states, unit_file_state_to_string(u->state)))
|
||||
return false;
|
||||
}
|
||||
|
||||
return !arg_types || ((dot = strrchr(u->path, '.')) && strv_find(arg_types, dot+1));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user