99#include "terminal-util.h"
1010#include "util.h"
1111
12- static int help (const char * program_path , const char * service , const char * description ) {
12+ static int help (const char * program_path , const char * service , const char * description , bool bus_introspect ) {
1313 _cleanup_free_ char * link = NULL ;
1414 int r ;
1515
@@ -23,6 +23,7 @@ static int help(const char *program_path, const char *service, const char *descr
2323 "%sOptions%s:\n"
2424 " -h --help Show this help\n"
2525 " --version Show package version\n"
26+ " --bus-introspect=PATH Write D-Bus XML introspection data\n"
2627 "\nSee the %s for details.\n"
2728 , program_path
2829 , ansi_highlight (), description , ansi_normal ()
@@ -36,15 +37,18 @@ static int help(const char *program_path, const char *service, const char *descr
3637int service_parse_argv (
3738 const char * service ,
3839 const char * description ,
40+ const BusObjectImplementation * const * bus_objects ,
3941 int argc , char * argv []) {
4042
4143 enum {
4244 ARG_VERSION = 0x100 ,
45+ ARG_BUS_INTROSPECT ,
4346 };
4447
4548 static const struct option options [] = {
4649 { "help" , no_argument , NULL , 'h' },
4750 { "version" , no_argument , NULL , ARG_VERSION },
51+ { "bus-introspect" , required_argument , NULL , ARG_BUS_INTROSPECT },
4852 {}
4953 };
5054
@@ -57,11 +61,17 @@ int service_parse_argv(
5761 switch (c ) {
5862
5963 case 'h' :
60- return help (argv [0 ], service , description );
64+ return help (argv [0 ], service , description , bus_objects );
6165
6266 case ARG_VERSION :
6367 return version ();
6468
69+ case ARG_BUS_INTROSPECT :
70+ return bus_introspect_implementations (
71+ stdout ,
72+ optarg ,
73+ bus_objects );
74+
6575 case '?' :
6676 return - EINVAL ;
6777
0 commit comments