cgls.c | cgls.c | |||
---|---|---|---|---|
skipping to change at line 49 | skipping to change at line 49 | |||
#include "bus-util.h" | #include "bus-util.h" | |||
#include "bus-error.h" | #include "bus-error.h" | |||
#include "unit-name.h" | #include "unit-name.h" | |||
static bool arg_no_pager = false; | static bool arg_no_pager = false; | |||
static bool arg_kernel_threads = false; | static bool arg_kernel_threads = false; | |||
static bool arg_all = false; | static bool arg_all = false; | |||
static int arg_full = -1; | static int arg_full = -1; | |||
static char* arg_machine = NULL; | static char* arg_machine = NULL; | |||
static int help(void) { | static void help(void) { | |||
printf("%s [OPTIONS...] [CGROUP...]\n\n" | printf("%s [OPTIONS...] [CGROUP...]\n\n" | |||
"Recursively show control group contents.\n\n" | "Recursively show control group contents.\n\n" | |||
" -h --help Show this help\n" | " -h --help Show this help\n" | |||
" --version Show package version\n" | " --version Show package version\n" | |||
" --no-pager Do not pipe output into a pager\n" | " --no-pager Do not pipe output into a pager\n" | |||
" -a --all Show all groups, including empty\n" | " -a --all Show all groups, including empty\n" | |||
" -l --full Do not ellipsize output\n" | " -l --full Do not ellipsize output\n" | |||
" -k Include kernel threads in output\n" | " -k Include kernel threads in output\n" | |||
" -M --machine Show container\n", | " -M --machine Show container\n" | |||
program_invocation_short_name); | , program_invocation_short_name); | |||
return 0; | ||||
} | } | |||
static int parse_argv(int argc, char *argv[]) { | static int parse_argv(int argc, char *argv[]) { | |||
enum { | enum { | |||
ARG_NO_PAGER = 0x100, | ARG_NO_PAGER = 0x100, | |||
ARG_VERSION, | ARG_VERSION, | |||
}; | }; | |||
static const struct option options[] = { | static const struct option options[] = { | |||
skipping to change at line 87 | skipping to change at line 84 | |||
{ "full", no_argument, NULL, 'l' }, | { "full", no_argument, NULL, 'l' }, | |||
{ "machine", required_argument, NULL, 'M' }, | { "machine", required_argument, NULL, 'M' }, | |||
{} | {} | |||
}; | }; | |||
int c; | int c; | |||
assert(argc >= 1); | assert(argc >= 1); | |||
assert(argv); | assert(argv); | |||
while ((c = getopt_long(argc, argv, "hkalM:", options, NULL)) >= 0) { | while ((c = getopt_long(argc, argv, "hkalM:", options, NULL)) >= 0) | |||
switch (c) { | switch (c) { | |||
case 'h': | case 'h': | |||
return help(); | help(); | |||
return 0; | ||||
case ARG_VERSION: | case ARG_VERSION: | |||
puts(PACKAGE_STRING); | puts(PACKAGE_STRING); | |||
puts(SYSTEMD_FEATURES); | puts(SYSTEMD_FEATURES); | |||
return 0; | return 0; | |||
case ARG_NO_PAGER: | case ARG_NO_PAGER: | |||
arg_no_pager = true; | arg_no_pager = true; | |||
break; | break; | |||
skipping to change at line 125 | skipping to change at line 123 | |||
case 'M': | case 'M': | |||
arg_machine = optarg; | arg_machine = optarg; | |||
break; | break; | |||
case '?': | case '?': | |||
return -EINVAL; | return -EINVAL; | |||
default: | default: | |||
assert_not_reached("Unhandled option"); | assert_not_reached("Unhandled option"); | |||
} | } | |||
} | ||||
return 1; | return 1; | |||
} | } | |||
int main(int argc, char *argv[]) { | int main(int argc, char *argv[]) { | |||
int r = 0, retval = EXIT_FAILURE; | int r = 0, retval = EXIT_FAILURE; | |||
int output_flags; | int output_flags; | |||
_cleanup_free_ char *root = NULL; | _cleanup_free_ char *root = NULL; | |||
_cleanup_bus_unref_ sd_bus *bus = NULL; | _cleanup_bus_close_unref_ sd_bus *bus = NULL; | |||
log_parse_environment(); | log_parse_environment(); | |||
log_open(); | log_open(); | |||
r = parse_argv(argc, argv); | r = parse_argv(argc, argv); | |||
if (r < 0) | if (r < 0) | |||
goto finish; | goto finish; | |||
else if (r == 0) { | else if (r == 0) { | |||
retval = EXIT_SUCCESS; | retval = EXIT_SUCCESS; | |||
goto finish; | goto finish; | |||
End of changes. 6 change blocks. | ||||
10 lines changed or deleted | 7 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |