Ticket #88 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

tools' error output for invalid arg is not helpful

Reported by: tedp Owned by: lennart
Milestone: Avahi 0.6.18 Component: avahi-utils
Keywords: Cc:

Description

When an invalid argument is provided to avahi tools, the particular argument that is invalid is not displayed. For example:

$ avahi-browse --foo
Invalid command line argument: ?

The following tools are affected:

  • avahi-resolve
  • avahi-browse
  • avahi-set-host-name
  • avahi-publish
  • avahi-daemon
  • avahi-autoipd
  • avahi-dnsconfd

The simplest solution is to enable the 'opterr' option (default is on) and let getopt provide an error message. A short patch making this change will be attached.

Attachments

avahi-invalid_arg.patch Download (4.1 KB) - added by tedp 6 years ago.

Change History

Changed 6 years ago by tedp

Changed 6 years ago by lennart

  • status changed from new to assigned
  • component changed from avahi-client to avahi-utils
  • milestone set to Avahi 0.6.17

Changed 6 years ago by lennart

  • status changed from assigned to closed
  • resolution set to fixed

(In [1358]) Fix error message when passing an invalid command line option (Closes #88)

Changed 6 years ago by lennart

BTW, I fixed this a little bit defferently than you suggested.

Thank you for your patch!

Changed 6 years ago by tedp

  • status changed from closed to reopened
  • resolution fixed deleted

I found a case where the current (fixed) code is still not helpful. The first example shows a working case, the second shows a failure:

$ ./avahi-autoipd -a
Invalid command line argument: -a
$ ./avahi-autoipd -ab
Invalid command line argument: ./avahi-autoipd

Changed 6 years ago by lathiat

  • milestone changed from Avahi 0.6.16 to Avahi 0.6.18

Changed 6 years ago by lennart

  • status changed from reopened to closed
  • resolution set to fixed

(In [1424]) Fix error message when passing invalid command line arguments. I admit defeat, tedp wins, merging his patch. (Closes #88)

Note: See TracTickets for help on using tickets.