summaryrefslogtreecommitdiff
path: root/src/shared/service-util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-04-28 17:55:34 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-05-05 22:34:17 +0200
commitd4cc0edfced262b34be4e113bd527e651f1f0024 (patch)
tree69cf1b9b0a2de2428ae0a0d9ac3dd4aea11f7cab /src/shared/service-util.c
parent1e9bc92dba49f77ef08b5e89cb78d69a84772148 (diff)
downloadsystemd-d4cc0edfced262b34be4e113bd527e651f1f0024.tar.gz
importd,logind: add --bus-introspect= option
Diffstat (limited to 'src/shared/service-util.c')
-rw-r--r--src/shared/service-util.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/shared/service-util.c b/src/shared/service-util.c
index 7fea74d2d9..c9b684fc05 100644
--- a/src/shared/service-util.c
+++ b/src/shared/service-util.c
@@ -9,7 +9,7 @@
#include "terminal-util.h"
#include "util.h"
-static int help(const char *program_path, const char *service, const char *description) {
+static int help(const char *program_path, const char *service, const char *description, bool bus_introspect) {
_cleanup_free_ char *link = NULL;
int r;
@@ -23,6 +23,7 @@ static int help(const char *program_path, const char *service, const char *descr
"%sOptions%s:\n"
" -h --help Show this help\n"
" --version Show package version\n"
+ " --bus-introspect=PATH Write D-Bus XML introspection data\n"
"\nSee the %s for details.\n"
, program_path
, ansi_highlight(), description, ansi_normal()
@@ -36,15 +37,18 @@ static int help(const char *program_path, const char *service, const char *descr
int service_parse_argv(
const char *service,
const char *description,
+ const BusObjectImplementation* const* bus_objects,
int argc, char *argv[]) {
enum {
ARG_VERSION = 0x100,
+ ARG_BUS_INTROSPECT,
};
static const struct option options[] = {
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, ARG_VERSION },
+ { "bus-introspect", required_argument, NULL, ARG_BUS_INTROSPECT },
{}
};
@@ -57,11 +61,17 @@ int service_parse_argv(
switch(c) {
case 'h':
- return help(argv[0], service, description);
+ return help(argv[0], service, description, bus_objects);
case ARG_VERSION:
return version();
+ case ARG_BUS_INTROSPECT:
+ return bus_introspect_implementations(
+ stdout,
+ optarg,
+ bus_objects);
+
case '?':
return -EINVAL;