[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: kldfind, updated for version 0.56
From:       "Rick C. Petty" <rick-freebsd () kiwi-computer ! com>
Date:       2006-05-24 18:17:51
Message-ID: 20060524181751.GA92607 () megan ! kiwi-computer ! com
[Download RAW message or body]

On Sun, May 21, 2006 at 02:28:29PM -0300, Ricardo A. Reis wrote:
> 
>       First about exit codes, when program is executed without options,  
> how this must return ?
>       kldunload and kldload not return the same exit codes,
> 
>    [ricardo@myfreebsd:~/kldfind] # kldload
> usage: kldload [-v] file ...
> zsh: 48524 exit 1     kldload
> 
> [ricardo@myfreebsd:~/kldfind] # kldunload
> usage: kldunload [-fv] -i id ...
>        kldunload [-fv] [-n] name ...
> zsh: 48539 exit 64    kldunload
> 
> [ricardo@myfreebsd:~/kldfind] # ./kldfind-v056
> usage: kldfind-v056 [-chqsv] ...
> 
>       In kldfind i return 0

See the manpage for sysexits(3).  Both should return EX_USAGE (64) in this
case.  You should only return EX_OK (0) if the command was successful.  If
you're spitting out usage text, return EX_USAGE.  Also by glancing at your
usage string, it's not apparent that specifying no options is an invalid
usage.  Without reading through your script, I'm not sure which options are
optional or which are required.  I read "[-chqsv]" meaning use any of those
options in any combination, or no options whatsoever.

Consider something like either:
	kldfind -c | -s | -h [-qv] modulename ...

or a multi-line usage (e.g. something like bsdlabel(1)):
	kldfind [-qv] -c category ...
	kldfind [-qv] -s string ...
	kldfind [-qv] -h

Personally, I'd prefer clarity over brevity.  Just my 3 cents,

-- Rick C. Petty
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic