]> git.ipfire.org Git - thirdparty/systemd.git/commit
cgls: print error messages when --unit and --user-unit are used together
authorjouyouyun <yanbowen@uniontech.com>
Tue, 4 Nov 2025 08:10:31 +0000 (16:10 +0800)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 4 Nov 2025 16:38:18 +0000 (01:38 +0900)
commit2b8c7adbecb929f131dc05d8b88babd87cc0ab22
treefed57d67d2798cdb947e2b6f371d782937465050
parenta8c3ac66721de23cceff359d946ecd9695bbacb8
cgls: print error messages when --unit and --user-unit are used together

Mixing the `--unit` and `--user-unit` options will result in error messages.
During the parsing phase, only the `arg_show_unit` record of the last
occurrence of the option is used; all names are placed in the same `arg_names`,
thus mixing the two types of units in the query.

For example, `-u foo --user-unit bar` will also treat `foo` as a user unit and
query it in the user service.
src/cgls/cgls.c