inncheck improvements

Julien ÉLIE julien at trigofacile.com
Thu Jul 7 11:01:12 UTC 2011


Hi Florian,

> inncheck: why not use Getopt::Long since it's available?
>
> ...I had to get clever with $perms, though, as -perm is not just the
> opposite of -noperm. So 1 is -perm, 0 is -noperm, and -1 is neither.
> Don't know if this introduces more confusion than it's worth?

OK, that works for me.

The only thing I changed is how the check of "--fix" is handled in your 
proposal ("inncheck --fix" does not report an error) whereas it used to do:

We previously had:

% inncheck -f
Usage error: Can't use `-fix' without `-perm'.


I have changed your proposal:

 > +&Usage("Can't use `-fix' with `-noperm'")
 > +    if $fix&&  !$perms;

to keep the current behaviour:

+&Usage("Can't use `--fix' without `--perm'")
+    if $fix && $perms < 1;


I hope that's fine for you.



> Also, we should perhaps use -fix instead of --fix in the manpage? Or
> rather change -perm to --perm etc, with -perm remaining as an
> undocumented feature for backward compatibility?

It will be proper with "--perm", "--fix", etc. in our documentation.
Changes committed to checklist.pod and inncheck.pod.
("-perm" and "-fix" are still valid.)



> NB: manpage and Usage() didn't agree on "-perm" vs. "-perms"

Now "--perm" everywhere.



>   "Usage:
> -	$program [-v] [-noperm] [-pedantic] [-perms [-fix] ] [-a|file...]
> +	$program [-v] [-noperm] [-pedantic] [-perm [-fix] ] [-a|file...]

Updated to:
$program [-afqv] [--noperm|perm] [--pedantic] [file | file=value...]

-- 
Julien ÉLIE

« Le cercle est le plus long chemin d'un point au même point. »
   (Tom Stoppard, _Every Good Boy Deserves Favour_)



More information about the inn-workers mailing list