#include "output-mode.h"
#include "pager.h"
#include "path-util.h"
+#include "pretty-print.h"
#include "strv.h"
-#include "terminal-util.h"
#include "unit-name.h"
#include "util.h"
" --version Show package version\n"
" --no-pager Do not pipe output into a pager\n"
" -a --all Show all groups, including empty\n"
- " -u --unit Show the subtrees of specifified system units\n"
- " --user-unit Show the subtrees of specifified user units\n"
+ " -u --unit Show the subtrees of specified system units\n"
+ " --user-unit Show the subtrees of specified user units\n"
" -l --full Do not ellipsize output\n"
" -k Include kernel threads in output\n"
" -M --machine= Show container\n"
assert_not_reached("Unhandled option");
}
- if (arg_machine && arg_show_unit != SHOW_UNIT_NONE) {
- log_error("Cannot combine --unit or --user-unit with --machine=.");
- return -EINVAL;
- }
+ if (arg_machine && arg_show_unit != SHOW_UNIT_NONE)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "Cannot combine --unit or --user-unit with --machine=.");
return 1;
}
static int run(int argc, char *argv[]) {
int r, output_flags;
+ log_show_color(true);
log_parse_environment();
log_open();
controller = c ?: SYSTEMD_CGROUP_CONTROLLER;
if (p) {
- j = strjoin(root, "/", p);
+ j = path_join(root, p);
if (!j)
return log_oom();