[Logcheck-devel] Bug#322054: [PATCH] Add GNU --long options support (for scripts)

Frédéric Brière fbriere at fbriere.net
Mon Aug 24 17:52:18 UTC 2009


On Sun, Aug 16, 2009 at 12:40:21PM +0300, Jari Aalto wrote:
> Could you brief me if these patches in BTS could be integrated to next
> logcheck release.

You're a very patient man, Jari.  :)


I've got some bugs and comments on your patch.  First, the bugs:

- Your second while loop will run endlessly and never exit.

- Most of your options are missing a shift.  Incidentally, try to keep
  the shifts at the end of each case, for consistency.

- logcheck currently does two passes of the arguments list, so that some
  options are handled before the others.  Your patch only does one pass,
  and requires that those options appear first on the command line.


And now the comments:

- Suddenly changing the -v option might not be seen as very nice.
  (Although I doubt there are many scripts out there asking for
  logcheck's version, it's best to play it safe.)  I would suggest
  adding the -V|--version option, but keeping -v for compatibility,
  perhaps deprecated.

- The --server option is inconsistent with the other two similar
  options.  Given the rather long names, I would suggest a --reportlevel
  option that takes 'paranoid', 'server' or 'workstation' as argument.

- I'd prefer --hostname to --host; it makes it clearer that we're not
  connecting to that host or anything.

- --log sounds like an action instead of an option.  How about --logfile
  and --logfiles-list?  (Although --logfile typically means logging *to*
  that file, so I welcome any suggestion.)

- I'm ambivalent on --email-subject-reboot; what about simply --reboot?
  (Maybe logcheck will eventually do more than change the subject on
  reboots, who knows.)

- Good catch on $CONFFILE not existing.  All it needs is a little
  quoting, actually; [ -r "" ] will return false.

- There are many unrelated whitespace changes, which should be kept
  separate.  (I'll take your suggestion and try to apply them
  beforehand.)

- No need to submit two patches; go ahead and fix both the script and
  documentation in one swoop.


Thank you for your work!


-- 
/*
 *     Please skip to the bottom of this file if you ate lunch recently
 *                             -- Alan
 */
		-- from Linux kernel pre-2.1.91-1





More information about the Logcheck-devel mailing list