From: Lennart Poettering Date: Wed, 16 Nov 2005 15:18:26 +0000 (+0000) Subject: add avahi-browse-domains as an alias for avahi-browse --browse-domains X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=affa11f5bb7309fa504624a3512dce5c88ce473b;p=catta add avahi-browse-domains as an alias for avahi-browse --browse-domains git-svn-id: file:///home/lennart/svn/public/avahi/trunk@983 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-utils/Makefile.am b/avahi-utils/Makefile.am index cc1de92..5d6bb9f 100644 --- a/avahi-utils/Makefile.am +++ b/avahi-utils/Makefile.am @@ -41,6 +41,10 @@ avahi_resolve_CFLAGS = $(AM_CFLAGS) avahi_resolve_LDADD = $(AM_LDADD) ../avahi-client/libavahi-client.la ../avahi-common/libavahi-common.la install-exec-local: - cd $(DESTDIR)/$(bindir) && rm -f avahi-resolve-host-name avahi-resolve-address && $(LN_S) avahi-resolve avahi-resolve-host-name && $(LN_S) avahi-resolve avahi-resolve-address + cd $(DESTDIR)/$(bindir) && \ + rm -f avahi-resolve-host-name avahi-resolve-address avahi-browse-domains && \ + $(LN_S) avahi-resolve avahi-resolve-host-name && \ + $(LN_S) avahi-resolve avahi-resolve-address && \ + $(LN_S) avahi-browse avahi-browse-domains endif diff --git a/avahi-utils/avahi-browse.c b/avahi-utils/avahi-browse.c index 4d427cf..e9c4073 100644 --- a/avahi-utils/avahi-browse.c +++ b/avahi-utils/avahi-browse.c @@ -573,10 +573,16 @@ static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UN } static void help(FILE *f, const char *argv0) { - fprintf(f, - "%s [options] \n" - "%s [options] -a\n" - "%s [options] -D\n\n" + if (strstr(argv0, "domain")) + fprintf(f, "%s [options] \n\n", argv0); + else + fprintf(f, + "%s [options] \n" + "%s [options] -a\n" + "%s [options] -D\n\n", + argv0, argv0, argv0); + + fprintf(f, " -h --help Show this help\n" " -V --version Show version\n" " -D --browse-domains Browse for browsing domains instead of services\n" @@ -589,12 +595,11 @@ static void help(FILE *f, const char *argv0) { " -r --resolve Resolve services found\n" " -f --no-fail Don't fail if the server is not available\n" #ifdef HAVE_GDBM - " -k --no-db-lookup Don't lookup service types\n" + " -k --no-db-lookup Don't lookup service types\n"); #endif - , argv0, argv0, argv0); } -static int parse_command_line(Config *c, int argc, char *argv[]) { +static int parse_command_line(Config *c, const char *argv0, int argc, char *argv[]) { int o; static const struct option long_options[] = { @@ -617,7 +622,7 @@ static int parse_command_line(Config *c, int argc, char *argv[]) { assert(c); - c->command = COMMAND_BROWSE_SERVICES; + c->command = strstr(argv0, "domain") ? COMMAND_BROWSE_DOMAINS : COMMAND_BROWSE_SERVICES; c->verbose = c->terminate_on_cache_exhausted = c->terminate_on_all_for_now = @@ -719,7 +724,7 @@ int main(int argc, char *argv[]) { if (n_columns < 40) n_columns = 40; - if (parse_command_line(&config, argc, argv) < 0) + if (parse_command_line(&config, argv0, argc, argv) < 0) goto fail; switch (config.command) { diff --git a/avahi-utils/avahi-resolve.c b/avahi-utils/avahi-resolve.c index 8fa8c89..477a4a5 100644 --- a/avahi-utils/avahi-resolve.c +++ b/avahi-utils/avahi-resolve.c @@ -173,7 +173,7 @@ static void help(FILE *f, const char *argv0) { argv0, strstr(argv0, "host-name") ? "[-n]" : "-n"); } -static int parse_command_line(Config *c, int argc, char *argv[]) { +static int parse_command_line(Config *c, const char *argv0, int argc, char *argv[]) { int o; static const struct option long_options[] = { @@ -187,7 +187,7 @@ static int parse_command_line(Config *c, int argc, char *argv[]) { assert(c); - c->command = strstr(argv[0], "address") ? COMMAND_RESOLVE_ADDRESS : (strstr(argv[0], "host-name") ? COMMAND_RESOLVE_HOST_NAME : COMMAND_UNSPEC); + c->command = strstr(argv0, "address") ? COMMAND_RESOLVE_ADDRESS : (strstr(argv0, "host-name") ? COMMAND_RESOLVE_HOST_NAME : COMMAND_UNSPEC); c->proto = AVAHI_PROTO_UNSPEC; c->verbose = 0; @@ -242,7 +242,7 @@ int main(int argc, char *argv[]) { else argv0 = argv[0]; - if (parse_command_line(&config, argc, argv) < 0) + if (parse_command_line(&config, argv0, argc, argv) < 0) goto fail; switch (config.command) { diff --git a/man/Makefile.am b/man/Makefile.am index 4beb7cb..9128e2c 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -180,6 +180,10 @@ EXTRA_DIST = \ if HAVE_DBUS install-exec-local: - cd $(DESTDIR)/$(mandir)/man1 && rm -f avahi-resolve-host-name.1 avahi-resolve-address.1 && $(LN_S) avahi-resolve.1 avahi-resolve-host-name.1 && $(LN_S) avahi-resolve.1 avahi-resolve-address.1 + cd $(DESTDIR)/$(mandir)/man1 && \ + rm -f avahi-resolve-host-name.1 avahi-resolve-address.1 avahi-browse-domains.1 && \ + $(LN_S) avahi-resolve.1 avahi-resolve-host-name.1 && \ + $(LN_S) avahi-resolve.1 avahi-resolve-address.1 && \ + $(LN_S) avahi-browse.1 avahi-browse-domains.1 endif diff --git a/man/avahi-browse.1.xml.in b/man/avahi-browse.1.xml.in index 6bf8103..5323317 100644 --- a/man/avahi-browse.1.xml.in +++ b/man/avahi-browse.1.xml.in @@ -29,6 +29,7 @@ avahi-browse [options] service-type avahi-browse [options] --all avahi-browse [options] --browse-domains + avahi-browse-domains [options] @@ -49,7 +50,7 @@