summaryrefslogtreecommitdiff
path: root/src/systemctl/systemctl-list-unit-files.c
Commit message (Collapse)AuthorAgeFilesLines
* shared/format-table: use enum instead of Table.empty_stringZbigniew Jędrzejewski-Szmek2022-09-221-1/+1
| | | | | | | | | | | | All users were setting this to some static string (usually "-"), so let's simplify things by not doing strdup, but instead limiting callers to a fixed set of values. In preparation for the next commit, the function is renamed from "empty" to "replacement", because it'll be used for more than empty fields. I didn't do the whole string-table setup, because it's all used internally in one file and this way we can immediately assert if an invalid value is passed in. Some callers were (void)ing the error, others were ignoring it, and others propagating. It's nicer to remove the boilerplate.
* systemctl: stop saying "vendor preset"Zbigniew Jędrzejewski-Szmek2022-05-041-1/+1
| | | | | | | | | | | | | | | We have vendor presets, and local admin presets, and runtime presets (under /usr/lib, /usr/local/lib and /etc, /run, respectively). When we display preset state, it can be configured in any of those places, so we shouldn't say anything about the origin. (Another nice advantage is that it improves alignment: [root@f36 ~]# systemctl list-unit-files multipathd.service UNIT FILE STATE VENDOR PRESET multipathd.service enabled enabled ^ this looks we have a "PRESET" column that is empty.)
* tree-wide: use strv_contains() in more placesZbigniew Jędrzejewski-Szmek2022-03-181-2/+2
|
* systemctl: systematically rename verb entrypoints verb_xyz()Lennart Poettering2022-02-221-1/+1
| | | | | | | | | Let's clean up our function naming a bit, and always name the verb_xyz(), where the xyz maps to the command line verb as closely as possible. No actual code changes, just an attempt to make the systemctl sources a bit more systematic, and less surprising.
* Make pager_open() return voidZbigniew Jędrzejewski-Szmek2021-11-031-1/+1
|
* alloc-util: simplify GREEDY_REALLOC() logic by relying on malloc_usable_size()Lennart Poettering2021-05-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | We recently started making more use of malloc_usable_size() and rely on it (see the string_erase() story). Given that we don't really support sytems where malloc_usable_size() cannot be trusted beyond statistics anyway, let's go fully in and rework GREEDY_REALLOC() on top of it: instead of passing around and maintaining the currenly allocated size everywhere, let's just derive it automatically from malloc_usable_size(). I am mostly after this for the simplicity this brings. It also brings minor efficiency improvements I guess, but things become so much nicer to look at if we can avoid these allocation size variables everywhere. Note that the malloc_usable_size() man page says relying on it wasn't "good programming practice", but I think it does this for reasons that don't apply here: the greedy realloc logic specifically doesn't rely on the returned extra size, beyond the fact that it is equal or larger than what was requested. (This commit was supposed to be a quick patch btw, but apparently we use the greedy realloc stuff quite a bit across the codebase, so this ends up touching *a*lot* of code.)
* Merge pull request #18596 from keszybz/systemctl-quiet-legendLennart Poettering2021-02-171-2/+2
|\ | | | | systemctl: hide legends with --quiet, allow overriding
| * systemctl: hide legends with --quiet, allow overridingZbigniew Jędrzejewski-Szmek2021-02-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | --no-legend is replaced by --legend=no. --quiet now implies --legend=no, but --legend=yes may be used to override that. --quiet controls hints and warnings and such, and --legend controls just the legends. I think it makes sense to allow both to controlled independently, in particular --quiet --legend makes sense when using systemctl in a script to provide some user-visible output. Fixes #18560.
* | systemctl: reduce scope of iterator variablesZbigniew Jędrzejewski-Szmek2021-02-151-2/+1
|/
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* systemctl: split up humungous systemctl.c fileLennart Poettering2020-10-071-0/+275
This is just some refactoring: shifting around of code, not change in codeflow. This splits up the way too huge systemctl.c in multiple more easily digestable files. It roughly follows the rule that each family of verbs gets its own .c/.h file pair, and so do all the compat executable names we support. Plus three extra files for sysv compat (which existed before already, but I renamed slightly, to get the systemctl- prefix lik everything else), a -util file with generic stuff everything uses, and a -logind file with everything that talks directly to logind instead of PID1. systemctl is still a bit too complex for my taste, but I think this way itc omes in a more digestable bits at least. No change of behaviour, just reshuffling of some code.