Adding an option
Jonathan Hayward -- http://JonathansCorner.com
jshayward at pobox.com
Wed Aug 29 18:32:01 CEST 2001
Werner Koch wrote:
> On Tue, 28 Aug 2001 13:26:23 -0500, "Jonathan Hayward said:
>
> > In my Tcl extension, I'm trying to add an option --passphrase
> > <passphrase>.
>
> Don't do this, everyone can do a ps and view the passphrase.
>
As a standalone process, definitely. As an argument passed from within
Tcl, it doesn't show up.
>
> > What are the steps involved in registering an option with the
argument
> > parser? It looks like I've left something out.
>
> Add a new name into the option enum (oFoo), add an entry to the list
> of options (use another otion which takes a string as a template) and
> finally add a case oFoo to the big options switch in main(). I thing
> --comment may be a goog example.
>
Hmm... I think I'm missing something.
I've added oPassphrase to the option enum, added
{ oPassphrase, "passphrase", 2, N_("|PASSPHRASE|use passphrase
PASSPHRASE")},
to the list of options, and added to the switch:
case oPassphrase:
fd_passwd = pargs.r.ret_str;
break;
The complaint it's giving is util/argparse.c, line 49 of function
initialize(); by the time that function checks, arg->r_opt has value
618.
Is there a reason arg->r_opt should contain a value that would trouble
argparse?
--
Jonathan Hayward
jshayward at pobox.com
http://JonathansCorner.com
(A four dimensional maze, stories, essays, artwork, and other things...)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20010829/73dfa286/attachment.htm
More information about the Gnupg-devel
mailing list