]> git.meshlink.io Git - catta/commitdiff
add avahi-browse-domains as an alias for avahi-browse --browse-domains
authorLennart Poettering <lennart@poettering.net>
Wed, 16 Nov 2005 15:18:26 +0000 (15:18 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 16 Nov 2005 15:18:26 +0000 (15:18 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@983 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-utils/Makefile.am
avahi-utils/avahi-browse.c
avahi-utils/avahi-resolve.c
man/Makefile.am
man/avahi-browse.1.xml.in

index cc1de9267094147b109cf9a9ecb762b186efabfc..5d6bb9f5fcd06033442a35a68ae504b124d8e0a0 100644 (file)
@@ -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
index 4d427cf2f465601858392be907f7d4f7fd57984c..e9c4073f3379aec423e7f2a863d5f1cbeb3fa090 100644 (file)
@@ -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) {
index 8fa8c89ec326ac2fa1070f3af87d63ca9ad2975c..477a4a57ae4c09d15550e1f12f393702bd863bea 100644 (file)
@@ -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) {
index 4beb7cba92fdb30a871414b066a08ebdc234df5a..9128e2c1b59d84ecd6a0849a00f6b05417b6bc2b 100644 (file)
@@ -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
index 6bf8103bb71863c33f8a7d0a614b19af752c8622..53233176bf7cbc3425daed1e1c696443ec3456a4 100644 (file)
@@ -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>