diff options
| -rw-r--r-- | avahi-utils/Makefile.am | 6 | ||||
| -rw-r--r-- | avahi-utils/avahi-browse.c | 23 | ||||
| -rw-r--r-- | avahi-utils/avahi-resolve.c | 6 | ||||
| -rw-r--r-- | man/Makefile.am | 6 | ||||
| -rw-r--r-- | man/avahi-browse.1.xml.in | 3 | 
5 files changed, 29 insertions, 15 deletions
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] <service type>\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] <service type>\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 @@        <cmd>avahi-browse [<arg>options</arg>] <arg>service-type</arg></cmd>        <cmd>avahi-browse [<arg>options</arg>] <opt>--all</opt></cmd>        <cmd>avahi-browse [<arg>options</arg>] <opt>--browse-domains</opt></cmd> +      <cmd>avahi-browse-domains [<arg>options</arg>]</cmd>  	</synopsis>      <description> @@ -49,7 +50,7 @@        <option>          <p><opt>-D | --browse-domains</opt></p> -        <optdesc><p>Browse for browsing domains instead for services.</p></optdesc> +        <optdesc><p>Browse for browsing domains instead for services. avahi-browse-domains is equivalent to avahi-browse --browse-domains</p></optdesc>        </option>   	  <option>  | 
