busctl.c | busctl.c | |||
---|---|---|---|---|
skipping to change at line 323 | skipping to change at line 323 | |||
if (r < 0) { | if (r < 0) { | |||
log_error("Failed to get credentials: %s", strerror(-r)); | log_error("Failed to get credentials: %s", strerror(-r)); | |||
return r; | return r; | |||
} | } | |||
bus_creds_dump(creds, NULL); | bus_creds_dump(creds, NULL); | |||
return 0; | return 0; | |||
} | } | |||
static int help(void) { | static int help(void) { | |||
printf("%s [OPTIONS...] {COMMAND} ...\n\n" | printf("%s [OPTIONS...] {COMMAND} ...\n\n" | |||
"Introspect the bus.\n\n" | "Introspect the bus.\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 " | |||
" --no-legend Do not show the headers and foote rs\n" | " --no-legend Do not show the headers and foote rs\n" | |||
" --system Connect to system bus\n" | " --system Connect to system bus\n" | |||
" --user Connect to user bus\n" | " --user Connect to user bus\n" | |||
" -H --host=[USER@]HOST Operate on remote host\n" | " -H --host=[USER@]HOST Operate on remote host\n" | |||
" -M --machine=CONTAINER Operate on local container\n" | " -M --machine=CONTAINER Operate on local container\n" | |||
" --address=ADDRESS Connect to bus specified by addre ss\n" | " --address=ADDRESS Connect to bus specified by addre ss\n" | |||
" --show-machine Show machine ID column in list\n" | " --show-machine Show machine ID column in list\n" | |||
" --unique Only show unique names\n" | " --unique Only show unique names\n" | |||
" --acquired Only show acquired names\n" | " --acquired Only show acquired names\n" | |||
" --activatable Only show activatable names\n" | " --activatable Only show activatable names\n" | |||
" --match=MATCH Only show matching messages\n\n" | " --match=MATCH Only show matching messages\n\n" | |||
"Commands:\n" | "Commands:\n" | |||
" list List bus names\n" | " list List bus names\n" | |||
" monitor [SERVICE...] Show bus traffic\n" | " monitor [SERVICE...] Show bus traffic\n" | |||
" status NAME Show name status\n" | " status NAME Show name status\n" | |||
" help Show this help\n", | " help Show this help\n" | |||
program_invocation_short_name); | , program_invocation_short_name); | |||
return 0; | return 0; | |||
} | } | |||
static int parse_argv(int argc, char *argv[]) { | static int parse_argv(int argc, char *argv[]) { | |||
enum { | enum { | |||
ARG_VERSION = 0x100, | ARG_VERSION = 0x100, | |||
ARG_NO_PAGER, | ARG_NO_PAGER, | |||
ARG_NO_LEGEND, | ARG_NO_LEGEND, | |||
skipping to change at line 389 | skipping to change at line 388 | |||
{ "host", required_argument, NULL, 'H' }, | { "host", required_argument, NULL, 'H' }, | |||
{ "machine", required_argument, NULL, 'M' }, | { "machine", required_argument, NULL, 'M' }, | |||
{}, | {}, | |||
}; | }; | |||
int c; | int c; | |||
assert(argc >= 0); | assert(argc >= 0); | |||
assert(argv); | assert(argv); | |||
while ((c = getopt_long(argc, argv, "hH:M:", options, NULL)) >= 0) { | while ((c = getopt_long(argc, argv, "hH:M:", options, NULL)) >= 0) | |||
switch (c) { | switch (c) { | |||
case 'h': | case 'h': | |||
return help(); | return help(); | |||
case ARG_VERSION: | case ARG_VERSION: | |||
puts(PACKAGE_STRING); | puts(PACKAGE_STRING); | |||
puts(SYSTEMD_FEATURES); | puts(SYSTEMD_FEATURES); | |||
return 0; | return 0; | |||
skipping to change at line 458 | skipping to change at line 457 | |||
arg_transport = BUS_TRANSPORT_CONTAINER; | arg_transport = BUS_TRANSPORT_CONTAINER; | |||
arg_host = optarg; | arg_host = optarg; | |||
break; | break; | |||
case '?': | case '?': | |||
return -EINVAL; | return -EINVAL; | |||
default: | default: | |||
assert_not_reached("Unhandled option"); | assert_not_reached("Unhandled option"); | |||
} | } | |||
} | ||||
if (!arg_unique && !arg_acquired && !arg_activatable) | if (!arg_unique && !arg_acquired && !arg_activatable) | |||
arg_unique = arg_acquired = arg_activatable = true; | arg_unique = arg_acquired = arg_activatable = true; | |||
return 1; | return 1; | |||
} | } | |||
static int busctl_main(sd_bus *bus, int argc, char *argv[]) { | static int busctl_main(sd_bus *bus, int argc, char *argv[]) { | |||
assert(bus); | assert(bus); | |||
skipping to change at line 487 | skipping to change at line 485 | |||
return status(bus, argv + optind); | return status(bus, argv + optind); | |||
if (streq(argv[optind], "help")) | if (streq(argv[optind], "help")) | |||
return help(); | return help(); | |||
log_error("Unknown command '%s'", argv[optind]); | log_error("Unknown command '%s'", argv[optind]); | |||
return -EINVAL; | return -EINVAL; | |||
} | } | |||
int main(int argc, char *argv[]) { | int main(int argc, char *argv[]) { | |||
_cleanup_bus_unref_ sd_bus *bus = NULL; | _cleanup_bus_close_unref_ sd_bus *bus = NULL; | |||
int r; | int r; | |||
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; | |||
r = sd_bus_new(&bus); | r = sd_bus_new(&bus); | |||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 4 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/ |