[avahi] /usr/bin/avahi-publish-service usage

Lennart Poettering lennart at poettering.de
Sat Aug 6 10:26:46 EST 2005


On Wed, 03.08.05 01:29, Sebastien Estienne (sebastien.estienne at gmail.com) wrote:

> seems that something doesn't work when  avahi-publish-service when no
> parameters or wrong number of parameters are passed, it doesn't
> display its usage
> 
> is the following the right fix?

Not quite. 

> Index: avahi-utils/avahi-publish-service.in
> ===================================================================
> --- avahi-utils/avahi-publish-service.in        (revision 211)
> +++ avahi-utils/avahi-publish-service.in        (working copy)
> @@ -19,7 +19,7 @@
>  try:
>      opts, args = getopt.getopt(sys.argv[1:], "d:H:", ["help",
> "domain=", "host="])
>  except getopt.GetoptError:
> -    usage(2)
> +    pass

This is not correct, an error that occurs with getopt shouldn't be
ignored.

>  domain = ""
>  host = ""
> @@ -35,8 +35,7 @@
>          host = a
> 
>  if len(args) < 3:
> -    sys.stderr.write("Invalid number of arguments\n")
> -    sys.exit(1)
> +    usage(2)

This part is fine.

You seem already to have commited this. So I reverted the first part a
few minutes ago. 

Anyway, thanks for the pointer!

Lennart

-- 
Lennart Poettering; lennart [at] poettering [dot] de
ICQ# 11060553; GPG 0x1A015CC4; http://0pointer.de/lennart/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/avahi/attachments/20050806/7b344dfa/attachment.pgp


More information about the avahi mailing list