systemctl,loginctl,cgls: do not ellipsize cgroup members when --full is specified

New file output.h with output flags and modes.

--full parameter also for cgls and loginctl.

Include 'all' parameter in flags (show_cgroup_by_path, show_cgroup,
show_cgroup_and_extra, show_cgroup_and_extra_by_spec).

get_process_cmdline with max_length == 0 will not ellipsize output.

Replace LINE_MAX with 0 in some calls of get_process_cmdline.

[zj: Default to --full when under pager for clgs.
     Drop '-f' since it wasn't documented and didn't actually work.
     Reindent a bit.
]
This commit is contained in:
Lukas Nykryn
2013-01-16 12:11:47 -05:00
committed by Zbigniew Jędrzejewski-Szmek
parent 2e72983463
commit 9bdbc2e2ec
15 changed files with 201 additions and 103 deletions
+7 -7
View File
@@ -2231,6 +2231,12 @@ static void print_status_info(UnitStatusInfo *i) {
char since1[FORMAT_TIMESTAMP_RELATIVE_MAX], *s1;
char since2[FORMAT_TIMESTAMP_MAX], *s2;
const char *path;
int flags =
arg_all * OUTPUT_SHOW_ALL |
(!on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
on_tty() * OUTPUT_COLOR |
!arg_quiet * OUTPUT_WARN_CUTOFF |
arg_full * OUTPUT_FULL_WIDTH;
assert(i);
@@ -2454,17 +2460,11 @@ static void print_status_info(UnitStatusInfo *i) {
if (i->control_pid > 0)
extra[k++] = i->control_pid;
show_cgroup_and_extra_by_spec(i->default_control_group, "\t\t ", c, false, arg_all, extra, k);
show_cgroup_and_extra_by_spec(i->default_control_group, "\t\t ", c, false, extra, k, flags);
}
}
if (i->id && arg_transport != TRANSPORT_SSH) {
int flags =
arg_all * OUTPUT_SHOW_ALL |
(!on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
on_tty() * OUTPUT_COLOR |
!arg_quiet * OUTPUT_WARN_CUTOFF;
printf("\n");
show_journal_by_unit(stdout,
i->id,