On Thu, 2 Aug 2007, Nelson Bolyard wrote:

> Craig Dunigan wrote:
>
>> Thanks David, but initially I couldn't even get far enough to make
>> pk12util complain about nicknames.  It simply wouldn't do anything but
>> return the usage message, which I assume means, like in other *nix
>> commands, that I have the syntax wrong.
>
> Yup.
>
>> On the chance that pk12util does not follow POSIX standard and is
>> sensitive to the order of command line options, I tried re-ordering
>> the options exactly following the usage message.  That seems to work,
>> or, at least, pk12util complained about the nickname.
>
> Hmmm. I tried pk12util commands with the options in the reverse of the
> order shown in the usage, and they all worked.  So I don't think order
> was the issue.
>
> Some common things that cause command line parsing errors include:
> a) not putting the space between the option letter and the option argument,
>   e.g. "-dcertdir" instead of "-d certdir"
> b) leaving out an option argument, e.g. "-d -P prefix" instead of
>   "-d dir -P prefix".
> c) thinking that all the option arguments can come after all the options,
>   e.g. expecting "-d -P dir prefix" or tar-style "-dP dir Prefix" to be
>   equivalent to "-d dir -P prefix".
>
> Single letter options can be combined (run together) provided that none
> of them, or only the last one of them, takes an option argument.
> e.g. "-vd dir" is equivalent to "-v -d dir".
>
>> I'm posting this in the hopes that someone else experiencing this will
>> search on "usage message" or "command syntax" in the maillist archive
>> before posting, like I did, and see the reason for the repeated usage
>> message.  I'm also hoping the developers might read it and consider
>> implementing the POSIX standard for command line options, or at least
>> including a note in the usage message that states that order of
>> options matters.
>
> If it does.  I think it doesn't.
>
> All these commands work properly.  These are actual commands I just did,
> and they all reported: "pk12util: PKCS12 IMPORT SUCCESSFUL"
>
> pk12util -i $IMPORTFILE -d $HOME -P prefix -K test -W nss -v
> pk12util -v -W nss -K test -P prefix -d $HOME  -i $IMPORTFILE
>
> These commands all work too:
>
> pk12util -l $LISTFILE -d $HOME -P prefix -W nss
> pk12util -W nss -P prefix -d $HOME -l $LISTFILE
> pk12util -v -l $LISTFILE -d $HOME -P prefix -W nss
> pk12util -vl $LISTFILE -d $HOME -P prefix -W nss
>
> /Nelson
>

First let me say how glad I am to see how responsive you all are on 
this project.  Thank you.

I reviewed my history file to see just what it was I actually did, 
instead of just what I remember doing.  You're right, of course.  I 
had another error in the commands that failed, that I also corrected 
at the same time I tried ordering the options.  Sorry, I made the 
classic leap to an incorrect conclusion because I changed more than 
one thing at a time.

I still maintain, though, that it would be a bit friendlier to report 
something about what was wrong with the syntax.  Seeing nothing more 
than "Usage" over and over is frustrating.  In my case, I kept reusing 
a mistyped option that didn't actually exist.  I was recalling the 
command from history first, and reviewing only the parts I thought 
were wrong each time.  I'd have reviewed the whole command if it had 
told me "no such option: '-a'," or even just "bad option," although 
actually telling me which option was bad is preferable.  But I suppose 
that suggestion could also just be defensiveness after making an ass 
of myself. :)


Craig Dunigan
IS Technical Services Specialist
Middleware - EIS - DoIT
University of Wisconsin, Madison

opinions expressed are my own, not the University's
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to