+2002-06-04 Werner Koch <wk@gnupg.org>
+
+ * gpgsm/t-encrypt.c (main): Add a simple option parser and allow
+ to specify an encryption key.
+
2002-05-26 Marcus Brinkmann <marcus@g10code.de>
* gpg/Makefile.am (all-local): Remove dependency on ./secring.gpg.
GpgmeError err;
GpgmeData in, out;
GpgmeRecipients rset;
+ int loop = 0;
+
+ /* simple option parser; ignoring unknown options */
+ if (argc)
+ {
+ argc--;
+ argv++;
+ }
+ while (argc && **argv == '-' )
+ {
+ if (!strcmp (*argv, "--loop"))
+ loop++;
+
+ argc--;
+ argv++;
+ if (!strcmp (argv[-1], "--"))
+ break;
+ }
+
err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS);
fail_if_err (err);
err = gpgme_recipients_new (&rset);
fail_if_err (err);
- err = gpgme_recipients_add_name_with_validity (rset,
+ if (argc)
+ err = gpgme_recipients_add_name_with_validity (rset, *argv,
+ GPGME_VALIDITY_FULL);
+ else
+ err = gpgme_recipients_add_name_with_validity (rset,
"/CN=test cert 1,OU=Aegypten Project,O=g10 Code GmbH,L=Düsseldorf,C=DE",
GPGME_VALIDITY_FULL);
fail_if_err (err);
gpgme_data_release (in);
gpgme_data_release (out);
gpgme_release (ctx);
- } while ( argc > 1 && !strcmp( argv[1], "--loop" ) );
+ } while (loop);
return 0;
}