mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
Use gpgrt's new option parser for the tools.
* agent/preset-passphrase.c: Switch to the new option parser. * agent/protect-tool.c: Ditto. * kbx/kbxutil.c: Ditto. * tools/gpg-card.c: Ditto. * tools/gpg-check-pattern.c: Ditto. * tools/gpg-connect-agent.c: Ditto. * tools/gpg-pair-tool.c: Ditto. * tools/gpg-wks-client.c: Ditto. * tools/gpg-wks-server.c: Ditto. * tools/gpgconf.c: Ditto. * tools/gpgsplit.c: Ditto. * tools/gpgtar.c: Ditto. -- This is another part of changes. A followup patch will address the remaining daemons. GnuPG-bug-id: 4788 Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
2c823bd878
commit
3bc004decd
@ -15,12 +15,10 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
/* We don't want to have the macros from gpgrt here until we have
|
|
||||||
* completely replaced this module by the one from gpgrt. */
|
|
||||||
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -52,7 +50,6 @@
|
|||||||
#include "../common/i18n.h"
|
#include "../common/i18n.h"
|
||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
#include "../common/argparse.h" /* temporary hack. */
|
|
||||||
|
|
||||||
|
|
||||||
enum cmd_and_opt_values
|
enum cmd_and_opt_values
|
||||||
@ -72,7 +69,7 @@ aTest };
|
|||||||
|
|
||||||
static const char *opt_passphrase;
|
static const char *opt_passphrase;
|
||||||
|
|
||||||
static ARGPARSE_OPTS opts[] = {
|
static gpgrt_opt_t opts[] = {
|
||||||
|
|
||||||
{ 301, NULL, 0, N_("@Options:\n ") },
|
{ 301, NULL, 0, N_("@Options:\n ") },
|
||||||
|
|
||||||
@ -93,9 +90,11 @@ my_strusage (int level)
|
|||||||
const char *p;
|
const char *p;
|
||||||
switch (level)
|
switch (level)
|
||||||
{
|
{
|
||||||
|
case 9: p = "GPL-3.0-or-later"; break;
|
||||||
case 11: p = "gpg-preset-passphrase (@GNUPG@)";
|
case 11: p = "gpg-preset-passphrase (@GNUPG@)";
|
||||||
break;
|
break;
|
||||||
case 13: p = VERSION; break;
|
case 13: p = VERSION; break;
|
||||||
|
case 14: p = GNUPG_DEF_COPYRIGHT_LINE; break;
|
||||||
case 17: p = PRINTABLE_OS_NAME; break;
|
case 17: p = PRINTABLE_OS_NAME; break;
|
||||||
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
||||||
|
|
||||||
@ -207,12 +206,12 @@ forget_passphrase (const char *keygrip)
|
|||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
ARGPARSE_ARGS pargs;
|
gpgrt_argparse_t pargs;
|
||||||
int cmd = 0;
|
int cmd = 0;
|
||||||
const char *keygrip = NULL;
|
const char *keygrip = NULL;
|
||||||
|
|
||||||
early_system_init ();
|
early_system_init ();
|
||||||
set_strusage (my_strusage);
|
gpgrt_set_strusage (my_strusage);
|
||||||
log_set_prefix ("gpg-preset-passphrase", GPGRT_LOG_WITH_PREFIX);
|
log_set_prefix ("gpg-preset-passphrase", GPGRT_LOG_WITH_PREFIX);
|
||||||
|
|
||||||
/* Make sure that our subsystems are ready. */
|
/* Make sure that our subsystems are ready. */
|
||||||
@ -221,8 +220,8 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
pargs.argc = &argc;
|
pargs.argc = &argc;
|
||||||
pargs.argv = &argv;
|
pargs.argv = &argv;
|
||||||
pargs.flags= 1; /* (do not remove the args) */
|
pargs.flags= ARGPARSE_FLAG_KEEP;
|
||||||
while (arg_parse (&pargs, opts) )
|
while (gpgrt_argparse (NULL, &pargs, opts))
|
||||||
{
|
{
|
||||||
switch (pargs.r_opt)
|
switch (pargs.r_opt)
|
||||||
{
|
{
|
||||||
@ -236,13 +235,15 @@ main (int argc, char **argv)
|
|||||||
default : pargs.err = 2; break;
|
default : pargs.err = 2; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
gpgrt_argparse (NULL, &pargs, NULL); /* Release internal state. */
|
||||||
|
|
||||||
if (log_get_errorcount(0))
|
if (log_get_errorcount(0))
|
||||||
exit(2);
|
exit(2);
|
||||||
|
|
||||||
if (argc == 1)
|
if (argc == 1)
|
||||||
keygrip = *argv;
|
keygrip = *argv;
|
||||||
else
|
else
|
||||||
usage (1);
|
gpgrt_usage (1);
|
||||||
|
|
||||||
/* Tell simple-pwquery about the standard socket name. */
|
/* Tell simple-pwquery about the standard socket name. */
|
||||||
{
|
{
|
||||||
|
@ -15,12 +15,10 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
/* We don't want to have the macros from gpgrt here until we have
|
|
||||||
* completely replaced this module by the one from gpgrt. */
|
|
||||||
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -46,7 +44,6 @@
|
|||||||
#include "../common/get-passphrase.h"
|
#include "../common/get-passphrase.h"
|
||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
#include "../common/argparse.h" /* temporary hack. */
|
|
||||||
|
|
||||||
|
|
||||||
enum cmd_and_opt_values
|
enum cmd_and_opt_values
|
||||||
@ -106,7 +103,7 @@ static char *get_passphrase (int promptno);
|
|||||||
static void release_passphrase (char *pw);
|
static void release_passphrase (char *pw);
|
||||||
|
|
||||||
|
|
||||||
static ARGPARSE_OPTS opts[] = {
|
static gpgrt_opt_t opts[] = {
|
||||||
ARGPARSE_group (300, N_("@Commands:\n ")),
|
ARGPARSE_group (300, N_("@Commands:\n ")),
|
||||||
|
|
||||||
ARGPARSE_c (oProtect, "protect", "protect a private key"),
|
ARGPARSE_c (oProtect, "protect", "protect a private key"),
|
||||||
@ -148,9 +145,11 @@ my_strusage (int level)
|
|||||||
const char *p;
|
const char *p;
|
||||||
switch (level)
|
switch (level)
|
||||||
{
|
{
|
||||||
|
case 9: p = "GPL-3.0-or-later"; break;
|
||||||
case 11: p = "gpg-protect-tool (" GNUPG_NAME ")";
|
case 11: p = "gpg-protect-tool (" GNUPG_NAME ")";
|
||||||
break;
|
break;
|
||||||
case 13: p = VERSION; break;
|
case 13: p = VERSION; break;
|
||||||
|
case 14: p = GNUPG_DEF_COPYRIGHT_LINE; break;
|
||||||
case 17: p = PRINTABLE_OS_NAME; break;
|
case 17: p = PRINTABLE_OS_NAME; break;
|
||||||
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
||||||
|
|
||||||
@ -556,13 +555,13 @@ show_keygrip (const char *fname)
|
|||||||
int
|
int
|
||||||
main (int argc, char **argv )
|
main (int argc, char **argv )
|
||||||
{
|
{
|
||||||
ARGPARSE_ARGS pargs;
|
gpgrt_argparse_t pargs;
|
||||||
int cmd = 0;
|
int cmd = 0;
|
||||||
const char *fname;
|
const char *fname;
|
||||||
ctrl_t ctrl;
|
ctrl_t ctrl;
|
||||||
|
|
||||||
early_system_init ();
|
early_system_init ();
|
||||||
set_strusage (my_strusage);
|
gpgrt_set_strusage (my_strusage);
|
||||||
gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
|
gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
|
||||||
log_set_prefix ("gpg-protect-tool", GPGRT_LOG_WITH_PREFIX);
|
log_set_prefix ("gpg-protect-tool", GPGRT_LOG_WITH_PREFIX);
|
||||||
|
|
||||||
@ -575,8 +574,8 @@ main (int argc, char **argv )
|
|||||||
|
|
||||||
pargs.argc = &argc;
|
pargs.argc = &argc;
|
||||||
pargs.argv = &argv;
|
pargs.argv = &argv;
|
||||||
pargs.flags= 1; /* (do not remove the args) */
|
pargs.flags= ARGPARSE_FLAG_KEEP;
|
||||||
while (arg_parse (&pargs, opts) )
|
while (gpgrt_argparse (NULL, &pargs, opts))
|
||||||
{
|
{
|
||||||
switch (pargs.r_opt)
|
switch (pargs.r_opt)
|
||||||
{
|
{
|
||||||
@ -606,6 +605,8 @@ main (int argc, char **argv )
|
|||||||
default: pargs.err = ARGPARSE_PRINT_ERROR; break;
|
default: pargs.err = ARGPARSE_PRINT_ERROR; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
gpgrt_argparse (NULL, &pargs, NULL); /* Release internal state. */
|
||||||
|
|
||||||
if (log_get_errorcount (0))
|
if (log_get_errorcount (0))
|
||||||
exit (2);
|
exit (2);
|
||||||
|
|
||||||
@ -613,7 +614,7 @@ main (int argc, char **argv )
|
|||||||
if (argc == 1)
|
if (argc == 1)
|
||||||
fname = *argv;
|
fname = *argv;
|
||||||
else if (argc > 1)
|
else if (argc > 1)
|
||||||
usage (1);
|
gpgrt_usage (1);
|
||||||
|
|
||||||
/* Allocate an CTRL object. An empty object should be sufficient. */
|
/* Allocate an CTRL object. An empty object should be sufficient. */
|
||||||
ctrl = xtrycalloc (1, sizeof *ctrl);
|
ctrl = xtrycalloc (1, sizeof *ctrl);
|
||||||
|
@ -15,12 +15,11 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
/* We don't want to have the macros from gpgrt here until we have
|
|
||||||
* completely replaced this module by the one from gpgrt. */
|
|
||||||
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -33,14 +32,12 @@
|
|||||||
|
|
||||||
#include <gpg-error.h>
|
#include <gpg-error.h>
|
||||||
#include "../common/logging.h"
|
#include "../common/logging.h"
|
||||||
#include "../common/argparse.h"
|
|
||||||
#include "../common/stringhelp.h"
|
#include "../common/stringhelp.h"
|
||||||
#include "../common/utf8conv.h"
|
#include "../common/utf8conv.h"
|
||||||
#include "../common/i18n.h"
|
#include "../common/i18n.h"
|
||||||
#include "keybox-defs.h"
|
#include "keybox-defs.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
#include <gcrypt.h>
|
#include <gcrypt.h>
|
||||||
#include "../common/argparse.h" /* temporary hack. */
|
|
||||||
|
|
||||||
|
|
||||||
enum cmd_and_opt_values {
|
enum cmd_and_opt_values {
|
||||||
@ -71,7 +68,7 @@ enum cmd_and_opt_values {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static ARGPARSE_OPTS opts[] = {
|
static gpgrt_opt_t opts[] = {
|
||||||
{ 300, NULL, 0, N_("@Commands:\n ") },
|
{ 300, NULL, 0, N_("@Commands:\n ") },
|
||||||
|
|
||||||
/* { aFindByFpr, "find-by-fpr", 0, "|FPR| find key using it's fingerprnt" }, */
|
/* { aFindByFpr, "find-by-fpr", 0, "|FPR| find key using it's fingerprnt" }, */
|
||||||
@ -108,27 +105,31 @@ int keybox_errors_seen = 0;
|
|||||||
static const char *
|
static const char *
|
||||||
my_strusage( int level )
|
my_strusage( int level )
|
||||||
{
|
{
|
||||||
const char *p;
|
const char *p;
|
||||||
switch( level ) {
|
|
||||||
case 11: p = "kbxutil (@GNUPG@)";
|
|
||||||
break;
|
|
||||||
case 13: p = VERSION; break;
|
|
||||||
case 17: p = PRINTABLE_OS_NAME; break;
|
|
||||||
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
|
||||||
|
|
||||||
case 1:
|
switch (level)
|
||||||
case 40: p =
|
{
|
||||||
_("Usage: kbxutil [options] [files] (-h for help)");
|
case 9: p = "GPL-3.0-or-later"; break;
|
||||||
break;
|
case 11: p = "kbxutil (@GNUPG@)";
|
||||||
case 41: p =
|
break;
|
||||||
_("Syntax: kbxutil [options] [files]\n"
|
case 13: p = VERSION; break;
|
||||||
"List, export, import Keybox data\n");
|
case 14: p = GNUPG_DEF_COPYRIGHT_LINE; break;
|
||||||
break;
|
case 17: p = PRINTABLE_OS_NAME; break;
|
||||||
|
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
case 40: p =
|
||||||
|
_("Usage: kbxutil [options] [files] (-h for help)");
|
||||||
|
break;
|
||||||
|
case 41: p =
|
||||||
|
_("Syntax: kbxutil [options] [files]\n"
|
||||||
|
"List, export, import Keybox data\n");
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
default: p = NULL;
|
default: p = NULL;
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -465,15 +466,15 @@ import_openpgp (const char *filename, int dryrun)
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main( int argc, char **argv )
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
ARGPARSE_ARGS pargs;
|
gpgrt_argparse_t pargs;
|
||||||
enum cmd_and_opt_values cmd = 0;
|
enum cmd_and_opt_values cmd = 0;
|
||||||
unsigned long from = 0, to = ULONG_MAX;
|
unsigned long from = 0, to = ULONG_MAX;
|
||||||
int dry_run = 0;
|
int dry_run = 0;
|
||||||
|
|
||||||
early_system_init ();
|
early_system_init ();
|
||||||
set_strusage( my_strusage );
|
gpgrt_set_strusage( my_strusage );
|
||||||
gcry_control (GCRYCTL_DISABLE_SECMEM);
|
gcry_control (GCRYCTL_DISABLE_SECMEM);
|
||||||
log_set_prefix ("kbxutil", GPGRT_LOG_WITH_PREFIX);
|
log_set_prefix ("kbxutil", GPGRT_LOG_WITH_PREFIX);
|
||||||
|
|
||||||
@ -491,8 +492,8 @@ main( int argc, char **argv )
|
|||||||
|
|
||||||
pargs.argc = &argc;
|
pargs.argc = &argc;
|
||||||
pargs.argv = &argv;
|
pargs.argv = &argv;
|
||||||
pargs.flags= 1; /* do not remove the args */
|
pargs.flags= ARGPARSE_FLAG_KEEP;
|
||||||
while (arg_parse( &pargs, opts) )
|
while (gpgrt_argparse (NULL,&pargs, opts))
|
||||||
{
|
{
|
||||||
switch (pargs.r_opt)
|
switch (pargs.r_opt)
|
||||||
{
|
{
|
||||||
@ -527,6 +528,7 @@ main( int argc, char **argv )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
gpgrt_argparse (NULL, &pargs, NULL);
|
||||||
|
|
||||||
if (to < from)
|
if (to < from)
|
||||||
log_error ("record number of \"--to\" is lower than \"--from\" one\n");
|
log_error ("record number of \"--to\" is lower than \"--from\" one\n");
|
||||||
|
@ -19,9 +19,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
/* We don't want to have the macros from gpgrt here until we have
|
|
||||||
* completely replaced this module by the one from gpgrt. */
|
|
||||||
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -44,7 +41,6 @@
|
|||||||
#include "../common/ttyio.h"
|
#include "../common/ttyio.h"
|
||||||
#include "../common/server-help.h"
|
#include "../common/server-help.h"
|
||||||
#include "../common/openpgpdefs.h"
|
#include "../common/openpgpdefs.h"
|
||||||
#include "../common/argparse.h" /* temporary hack. */
|
|
||||||
|
|
||||||
#include "gpg-card.h"
|
#include "gpg-card.h"
|
||||||
|
|
||||||
@ -82,7 +78,7 @@ enum opt_values
|
|||||||
|
|
||||||
|
|
||||||
/* The list of commands and options. */
|
/* The list of commands and options. */
|
||||||
static ARGPARSE_OPTS opts[] = {
|
static gpgrt_opt_t opts[] = {
|
||||||
ARGPARSE_group (301, ("@\nOptions:\n ")),
|
ARGPARSE_group (301, ("@\nOptions:\n ")),
|
||||||
|
|
||||||
ARGPARSE_s_n (oVerbose, "verbose", ("verbose")),
|
ARGPARSE_s_n (oVerbose, "verbose", ("verbose")),
|
||||||
@ -154,9 +150,11 @@ my_strusage( int level )
|
|||||||
|
|
||||||
switch (level)
|
switch (level)
|
||||||
{
|
{
|
||||||
|
case 9: p = "GPL-3.0-or-later"; break;
|
||||||
case 11: p = "gpg-card"; break;
|
case 11: p = "gpg-card"; break;
|
||||||
case 12: p = "@GNUPG@"; break;
|
case 12: p = "@GNUPG@"; break;
|
||||||
case 13: p = VERSION; break;
|
case 13: p = VERSION; break;
|
||||||
|
case 14: p = GNUPG_DEF_COPYRIGHT_LINE; break;
|
||||||
case 17: p = PRINTABLE_OS_NAME; break;
|
case 17: p = PRINTABLE_OS_NAME; break;
|
||||||
case 19: p = ("Please report bugs to <@EMAIL@>.\n"); break;
|
case 19: p = ("Please report bugs to <@EMAIL@>.\n"); break;
|
||||||
|
|
||||||
@ -193,9 +191,9 @@ set_opt_session_env (const char *name, const char *value)
|
|||||||
|
|
||||||
/* Command line parsing. */
|
/* Command line parsing. */
|
||||||
static void
|
static void
|
||||||
parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)
|
parse_arguments (gpgrt_argparse_t *pargs, gpgrt_opt_t *popts)
|
||||||
{
|
{
|
||||||
while (optfile_parse (NULL, NULL, NULL, pargs, popts))
|
while (gpgrt_argparse (NULL, pargs, popts))
|
||||||
{
|
{
|
||||||
switch (pargs->r_opt)
|
switch (pargs->r_opt)
|
||||||
{
|
{
|
||||||
@ -242,13 +240,13 @@ int
|
|||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
ARGPARSE_ARGS pargs;
|
gpgrt_argparse_t pargs;
|
||||||
char **command_list = NULL;
|
char **command_list = NULL;
|
||||||
int cmdidx;
|
int cmdidx;
|
||||||
char *command;
|
char *command;
|
||||||
|
|
||||||
gnupg_reopen_std ("gpg-card");
|
gnupg_reopen_std ("gpg-card");
|
||||||
set_strusage (my_strusage);
|
gpgrt_set_strusage (my_strusage);
|
||||||
gnupg_rl_initialize ();
|
gnupg_rl_initialize ();
|
||||||
log_set_prefix ("gpg-card", GPGRT_LOG_WITH_PREFIX);
|
log_set_prefix ("gpg-card", GPGRT_LOG_WITH_PREFIX);
|
||||||
|
|
||||||
@ -272,6 +270,7 @@ main (int argc, char **argv)
|
|||||||
pargs.argv = &argv;
|
pargs.argv = &argv;
|
||||||
pargs.flags = ARGPARSE_FLAG_KEEP;
|
pargs.flags = ARGPARSE_FLAG_KEEP;
|
||||||
parse_arguments (&pargs, opts);
|
parse_arguments (&pargs, opts);
|
||||||
|
gpgrt_argparse (NULL, &pargs, NULL); /* Release internal state. */
|
||||||
|
|
||||||
if (log_get_errorcount (0))
|
if (log_get_errorcount (0))
|
||||||
exit (2);
|
exit (2);
|
||||||
|
@ -15,12 +15,10 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
/* We don't want to have the macros from gpgrt here until we have
|
|
||||||
* completely replaced this module by the one from gpgrt. */
|
|
||||||
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -47,7 +45,6 @@
|
|||||||
#include "../common/i18n.h"
|
#include "../common/i18n.h"
|
||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
#include "../common/argparse.h" /* temporary hack. */
|
|
||||||
|
|
||||||
|
|
||||||
enum cmd_and_opt_values
|
enum cmd_and_opt_values
|
||||||
@ -68,7 +65,7 @@ enum cmd_and_opt_values
|
|||||||
|
|
||||||
|
|
||||||
/* The list of commands and options. */
|
/* The list of commands and options. */
|
||||||
static ARGPARSE_OPTS opts[] = {
|
static gpgrt_opt_t opts[] = {
|
||||||
|
|
||||||
{ 301, NULL, 0, N_("@Options:\n ") },
|
{ 301, NULL, 0, N_("@Options:\n ") },
|
||||||
|
|
||||||
@ -137,9 +134,11 @@ my_strusage (int level)
|
|||||||
const char *p;
|
const char *p;
|
||||||
switch (level)
|
switch (level)
|
||||||
{
|
{
|
||||||
|
case 9: p = "GPL-3.0-or-later"; break;
|
||||||
case 11: p = "gpg-check-pattern (@GnuPG@)";
|
case 11: p = "gpg-check-pattern (@GnuPG@)";
|
||||||
break;
|
break;
|
||||||
case 13: p = VERSION; break;
|
case 13: p = VERSION; break;
|
||||||
|
case 14: p = GNUPG_DEF_COPYRIGHT_LINE; break;
|
||||||
case 17: p = PRINTABLE_OS_NAME; break;
|
case 17: p = PRINTABLE_OS_NAME; break;
|
||||||
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
||||||
|
|
||||||
@ -161,13 +160,13 @@ my_strusage (int level)
|
|||||||
int
|
int
|
||||||
main (int argc, char **argv )
|
main (int argc, char **argv )
|
||||||
{
|
{
|
||||||
ARGPARSE_ARGS pargs;
|
gpgrt_argparse_t pargs;
|
||||||
char *raw_pattern;
|
char *raw_pattern;
|
||||||
size_t raw_pattern_length;
|
size_t raw_pattern_length;
|
||||||
pattern_t *patternarray;
|
pattern_t *patternarray;
|
||||||
|
|
||||||
early_system_init ();
|
early_system_init ();
|
||||||
set_strusage (my_strusage);
|
gpgrt_set_strusage (my_strusage);
|
||||||
gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
|
gcry_control (GCRYCTL_SUSPEND_SECMEM_WARN);
|
||||||
log_set_prefix ("gpg-check-pattern", GPGRT_LOG_WITH_PREFIX);
|
log_set_prefix ("gpg-check-pattern", GPGRT_LOG_WITH_PREFIX);
|
||||||
|
|
||||||
@ -180,8 +179,8 @@ main (int argc, char **argv )
|
|||||||
|
|
||||||
pargs.argc = &argc;
|
pargs.argc = &argc;
|
||||||
pargs.argv = &argv;
|
pargs.argv = &argv;
|
||||||
pargs.flags= 1; /* (do not remove the args) */
|
pargs.flags= ARGPARSE_FLAG_KEEP;
|
||||||
while (arg_parse (&pargs, opts) )
|
while (gpgrt_argparse (NULL, &pargs, opts))
|
||||||
{
|
{
|
||||||
switch (pargs.r_opt)
|
switch (pargs.r_opt)
|
||||||
{
|
{
|
||||||
@ -193,11 +192,12 @@ main (int argc, char **argv )
|
|||||||
default : pargs.err = 2; break;
|
default : pargs.err = 2; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
gpgrt_argparse (NULL, &pargs, NULL); /* Release internal state. */
|
||||||
if (log_get_errorcount(0))
|
if (log_get_errorcount(0))
|
||||||
exit (2);
|
exit (2);
|
||||||
|
|
||||||
if (argc != 1)
|
if (argc != 1)
|
||||||
usage (1);
|
gpgrt_usage (1);
|
||||||
|
|
||||||
/* We read the entire pattern file into our memory and parse it
|
/* We read the entire pattern file into our memory and parse it
|
||||||
using a separate function. This allows us to eventual do the
|
using a separate function. This allows us to eventual do the
|
||||||
|
@ -16,13 +16,10 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
/* We don't want to have the macros from gpgrt here until we have
|
|
||||||
* completely replaced this module by the one from gpgrt. */
|
|
||||||
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -34,7 +31,6 @@
|
|||||||
|
|
||||||
#include "../common/i18n.h"
|
#include "../common/i18n.h"
|
||||||
#include "../common/util.h"
|
#include "../common/util.h"
|
||||||
#include "../common/argparse.h" /* temporary hack. */
|
|
||||||
#include "../common/asshelp.h"
|
#include "../common/asshelp.h"
|
||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
#include "../common/membuf.h"
|
#include "../common/membuf.h"
|
||||||
@ -77,7 +73,7 @@ enum cmd_and_opt_values
|
|||||||
|
|
||||||
|
|
||||||
/* The list of commands and options. */
|
/* The list of commands and options. */
|
||||||
static ARGPARSE_OPTS opts[] = {
|
static gpgrt_opt_t opts[] = {
|
||||||
ARGPARSE_group (301, N_("@\nOptions:\n ")),
|
ARGPARSE_group (301, N_("@\nOptions:\n ")),
|
||||||
|
|
||||||
ARGPARSE_s_n (oVerbose, "verbose", N_("verbose")),
|
ARGPARSE_s_n (oVerbose, "verbose", N_("verbose")),
|
||||||
@ -205,9 +201,11 @@ my_strusage( int level )
|
|||||||
|
|
||||||
switch (level)
|
switch (level)
|
||||||
{
|
{
|
||||||
|
case 9: p = "GPL-3.0-or-later"; break;
|
||||||
case 11: p = "@GPG@-connect-agent (@GNUPG@)";
|
case 11: p = "@GPG@-connect-agent (@GNUPG@)";
|
||||||
break;
|
break;
|
||||||
case 13: p = VERSION; break;
|
case 13: p = VERSION; break;
|
||||||
|
case 14: p = GNUPG_DEF_COPYRIGHT_LINE; break;
|
||||||
case 17: p = PRINTABLE_OS_NAME; break;
|
case 17: p = PRINTABLE_OS_NAME; break;
|
||||||
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
||||||
|
|
||||||
@ -1158,7 +1156,7 @@ help_cmd_p (const char *line)
|
|||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
ARGPARSE_ARGS pargs;
|
gpgrt_argparse_t pargs;
|
||||||
int no_more_options = 0;
|
int no_more_options = 0;
|
||||||
assuan_context_t ctx;
|
assuan_context_t ctx;
|
||||||
char *line, *p;
|
char *line, *p;
|
||||||
@ -1183,7 +1181,7 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
early_system_init ();
|
early_system_init ();
|
||||||
gnupg_rl_initialize ();
|
gnupg_rl_initialize ();
|
||||||
set_strusage (my_strusage);
|
gpgrt_set_strusage (my_strusage);
|
||||||
log_set_prefix ("gpg-connect-agent", GPGRT_LOG_WITH_PREFIX);
|
log_set_prefix ("gpg-connect-agent", GPGRT_LOG_WITH_PREFIX);
|
||||||
|
|
||||||
/* Make sure that our subsystems are ready. */
|
/* Make sure that our subsystems are ready. */
|
||||||
@ -1199,8 +1197,8 @@ main (int argc, char **argv)
|
|||||||
/* Parse the command line. */
|
/* Parse the command line. */
|
||||||
pargs.argc = &argc;
|
pargs.argc = &argc;
|
||||||
pargs.argv = &argv;
|
pargs.argv = &argv;
|
||||||
pargs.flags = 1; /* Do not remove the args. */
|
pargs.flags = ARGPARSE_FLAG_KEEP;
|
||||||
while (!no_more_options && optfile_parse (NULL, NULL, NULL, &pargs, opts))
|
while (!no_more_options && gpgrt_argparse (NULL, &pargs, opts))
|
||||||
{
|
{
|
||||||
switch (pargs.r_opt)
|
switch (pargs.r_opt)
|
||||||
{
|
{
|
||||||
@ -1230,6 +1228,7 @@ main (int argc, char **argv)
|
|||||||
default: pargs.err = 2; break;
|
default: pargs.err = 2; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
gpgrt_argparse (NULL, &pargs, NULL); /* Release internal state. */
|
||||||
|
|
||||||
if (log_get_errorcount (0))
|
if (log_get_errorcount (0))
|
||||||
exit (2);
|
exit (2);
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||||
|
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Protocol:
|
/* Protocol:
|
||||||
@ -120,9 +121,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
/* We don't want to have the macros from gpgrt here until we have
|
|
||||||
* completely replaced this module by the one from gpgrt. */
|
|
||||||
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -138,8 +137,6 @@
|
|||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
#include "../common/name-value.h"
|
#include "../common/name-value.h"
|
||||||
#include "../common/argparse.h" /* temporary hack. */
|
|
||||||
|
|
||||||
|
|
||||||
/* Constants to identify the commands and options. */
|
/* Constants to identify the commands and options. */
|
||||||
enum cmd_and_opt_values
|
enum cmd_and_opt_values
|
||||||
@ -292,7 +289,8 @@ my_strusage( int level )
|
|||||||
static void
|
static void
|
||||||
wrong_args (const char *text)
|
wrong_args (const char *text)
|
||||||
{
|
{
|
||||||
es_fprintf (es_stderr, _("usage: %s [options] %s\n"), strusage (11), text);
|
es_fprintf (es_stderr, _("usage: %s [options] %s\n"),
|
||||||
|
gpgrt_strusage (11), text);
|
||||||
exit (2);
|
exit (2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,6 +414,7 @@ main (int argc, char **argv)
|
|||||||
default: pargs.err = ARGPARSE_PRINT_WARNING; break;
|
default: pargs.err = ARGPARSE_PRINT_WARNING; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
gpgrt_argparse (NULL, &pargs, NULL); /* Release internal state. */
|
||||||
|
|
||||||
/* Print a warning if an argument looks like an option. */
|
/* Print a warning if an argument looks like an option. */
|
||||||
if (!opt.quiet && !(pargs.flags & ARGPARSE_FLAG_STOP_SEEN))
|
if (!opt.quiet && !(pargs.flags & ARGPARSE_FLAG_STOP_SEEN))
|
||||||
|
@ -16,12 +16,11 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||||
|
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
/* We don't want to have the macros from gpgrt here until we have
|
|
||||||
* completely replaced this module by the one from gpgrt. */
|
|
||||||
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -44,7 +43,6 @@
|
|||||||
#include "mime-maker.h"
|
#include "mime-maker.h"
|
||||||
#include "send-mail.h"
|
#include "send-mail.h"
|
||||||
#include "gpg-wks.h"
|
#include "gpg-wks.h"
|
||||||
#include "../common/argparse.h" /* temporary hack. */
|
|
||||||
|
|
||||||
|
|
||||||
/* Constants to identify the commands and options. */
|
/* Constants to identify the commands and options. */
|
||||||
@ -80,7 +78,7 @@ enum cmd_and_opt_values
|
|||||||
|
|
||||||
|
|
||||||
/* The list of commands and options. */
|
/* The list of commands and options. */
|
||||||
static ARGPARSE_OPTS opts[] = {
|
static gpgrt_opt_t opts[] = {
|
||||||
ARGPARSE_group (300, ("@Commands:\n ")),
|
ARGPARSE_group (300, ("@Commands:\n ")),
|
||||||
|
|
||||||
ARGPARSE_c (aSupported, "supported",
|
ARGPARSE_c (aSupported, "supported",
|
||||||
@ -163,9 +161,11 @@ my_strusage( int level )
|
|||||||
|
|
||||||
switch (level)
|
switch (level)
|
||||||
{
|
{
|
||||||
|
case 9: p = "LGPL-2.1-or-later"; break;
|
||||||
case 11: p = "gpg-wks-client"; break;
|
case 11: p = "gpg-wks-client"; break;
|
||||||
case 12: p = "@GNUPG@"; break;
|
case 12: p = "@GNUPG@"; break;
|
||||||
case 13: p = VERSION; break;
|
case 13: p = VERSION; break;
|
||||||
|
case 14: p = GNUPG_DEF_COPYRIGHT_LINE; break;
|
||||||
case 17: p = PRINTABLE_OS_NAME; break;
|
case 17: p = PRINTABLE_OS_NAME; break;
|
||||||
case 19: p = ("Please report bugs to <@EMAIL@>.\n"); break;
|
case 19: p = ("Please report bugs to <@EMAIL@>.\n"); break;
|
||||||
|
|
||||||
@ -187,7 +187,8 @@ my_strusage( int level )
|
|||||||
static void
|
static void
|
||||||
wrong_args (const char *text)
|
wrong_args (const char *text)
|
||||||
{
|
{
|
||||||
es_fprintf (es_stderr, _("usage: %s [options] %s\n"), strusage (11), text);
|
es_fprintf (es_stderr, _("usage: %s [options] %s\n"),
|
||||||
|
gpgrt_strusage (11), text);
|
||||||
exit (2);
|
exit (2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,12 +196,12 @@ wrong_args (const char *text)
|
|||||||
|
|
||||||
/* Command line parsing. */
|
/* Command line parsing. */
|
||||||
static enum cmd_and_opt_values
|
static enum cmd_and_opt_values
|
||||||
parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)
|
parse_arguments (gpgrt_argparse_t *pargs, gpgrt_opt_t *popts)
|
||||||
{
|
{
|
||||||
enum cmd_and_opt_values cmd = 0;
|
enum cmd_and_opt_values cmd = 0;
|
||||||
int no_more_options = 0;
|
int no_more_options = 0;
|
||||||
|
|
||||||
while (!no_more_options && optfile_parse (NULL, NULL, NULL, pargs, popts))
|
while (!no_more_options && gpgrt_argparse (NULL, pargs, popts))
|
||||||
{
|
{
|
||||||
switch (pargs->r_opt)
|
switch (pargs->r_opt)
|
||||||
{
|
{
|
||||||
@ -248,7 +249,7 @@ parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)
|
|||||||
cmd = pargs->r_opt;
|
cmd = pargs->r_opt;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: pargs->err = 2; break;
|
default: pargs->err = ARGPARSE_PRINT_ERROR; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,11 +263,11 @@ int
|
|||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
gpg_error_t err, delayed_err;
|
gpg_error_t err, delayed_err;
|
||||||
ARGPARSE_ARGS pargs;
|
gpgrt_argparse_t pargs;
|
||||||
enum cmd_and_opt_values cmd;
|
enum cmd_and_opt_values cmd;
|
||||||
|
|
||||||
gnupg_reopen_std ("gpg-wks-client");
|
gnupg_reopen_std ("gpg-wks-client");
|
||||||
set_strusage (my_strusage);
|
gpgrt_set_strusage (my_strusage);
|
||||||
log_set_prefix ("gpg-wks-client", GPGRT_LOG_WITH_PREFIX);
|
log_set_prefix ("gpg-wks-client", GPGRT_LOG_WITH_PREFIX);
|
||||||
|
|
||||||
/* Make sure that our subsystems are ready. */
|
/* Make sure that our subsystems are ready. */
|
||||||
@ -281,6 +282,7 @@ main (int argc, char **argv)
|
|||||||
pargs.argv = &argv;
|
pargs.argv = &argv;
|
||||||
pargs.flags = ARGPARSE_FLAG_KEEP;
|
pargs.flags = ARGPARSE_FLAG_KEEP;
|
||||||
cmd = parse_arguments (&pargs, opts);
|
cmd = parse_arguments (&pargs, opts);
|
||||||
|
gpgrt_argparse (NULL, &pargs, NULL);
|
||||||
|
|
||||||
if (log_get_errorcount (0))
|
if (log_get_errorcount (0))
|
||||||
exit (2);
|
exit (2);
|
||||||
@ -426,7 +428,7 @@ main (int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
usage (1);
|
gpgrt_usage (1);
|
||||||
err = 0;
|
err = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||||
|
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* The Web Key Service I-D defines an update protocol to store a
|
/* The Web Key Service I-D defines an update protocol to store a
|
||||||
@ -24,9 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
/* We don't want to have the macros from gpgrt here until we have
|
|
||||||
* completely replaced this module by the one from gpgrt. */
|
|
||||||
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -48,7 +47,6 @@
|
|||||||
#include "mime-maker.h"
|
#include "mime-maker.h"
|
||||||
#include "send-mail.h"
|
#include "send-mail.h"
|
||||||
#include "gpg-wks.h"
|
#include "gpg-wks.h"
|
||||||
#include "../common/argparse.h" /* temporary hack. */
|
|
||||||
|
|
||||||
|
|
||||||
/* The time we wait for a confirmation response. */
|
/* The time we wait for a confirmation response. */
|
||||||
@ -87,7 +85,7 @@ enum cmd_and_opt_values
|
|||||||
|
|
||||||
|
|
||||||
/* The list of commands and options. */
|
/* The list of commands and options. */
|
||||||
static ARGPARSE_OPTS opts[] = {
|
static gpgrt_opt_t opts[] = {
|
||||||
ARGPARSE_group (300, ("@Commands:\n ")),
|
ARGPARSE_group (300, ("@Commands:\n ")),
|
||||||
|
|
||||||
ARGPARSE_c (aReceive, "receive",
|
ARGPARSE_c (aReceive, "receive",
|
||||||
@ -176,9 +174,11 @@ my_strusage( int level )
|
|||||||
|
|
||||||
switch (level)
|
switch (level)
|
||||||
{
|
{
|
||||||
|
case 9: p = "LGPL-2.1-or-later"; break;
|
||||||
case 11: p = "gpg-wks-server"; break;
|
case 11: p = "gpg-wks-server"; break;
|
||||||
case 12: p = "@GNUPG@"; break;
|
case 12: p = "@GNUPG@"; break;
|
||||||
case 13: p = VERSION; break;
|
case 13: p = VERSION; break;
|
||||||
|
case 14: p = GNUPG_DEF_COPYRIGHT_LINE; break;
|
||||||
case 17: p = PRINTABLE_OS_NAME; break;
|
case 17: p = PRINTABLE_OS_NAME; break;
|
||||||
case 19: p = ("Please report bugs to <@EMAIL@>.\n"); break;
|
case 19: p = ("Please report bugs to <@EMAIL@>.\n"); break;
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ my_strusage( int level )
|
|||||||
static void
|
static void
|
||||||
wrong_args (const char *text)
|
wrong_args (const char *text)
|
||||||
{
|
{
|
||||||
es_fprintf (es_stderr, "usage: %s [options] %s\n", strusage (11), text);
|
es_fprintf (es_stderr, "usage: %s [options] %s\n", gpgrt_strusage (11), text);
|
||||||
exit (2);
|
exit (2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,12 +208,12 @@ wrong_args (const char *text)
|
|||||||
|
|
||||||
/* Command line parsing. */
|
/* Command line parsing. */
|
||||||
static enum cmd_and_opt_values
|
static enum cmd_and_opt_values
|
||||||
parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)
|
parse_arguments (gpgrt_argparse_t *pargs, gpgrt_opt_t *popts)
|
||||||
{
|
{
|
||||||
enum cmd_and_opt_values cmd = 0;
|
enum cmd_and_opt_values cmd = 0;
|
||||||
int no_more_options = 0;
|
int no_more_options = 0;
|
||||||
|
|
||||||
while (!no_more_options && optfile_parse (NULL, NULL, NULL, pargs, popts))
|
while (!no_more_options && gpgrt_argparse (NULL, pargs, popts))
|
||||||
{
|
{
|
||||||
switch (pargs->r_opt)
|
switch (pargs->r_opt)
|
||||||
{
|
{
|
||||||
@ -262,7 +262,7 @@ parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)
|
|||||||
cmd = pargs->r_opt;
|
cmd = pargs->r_opt;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: pargs->err = 2; break;
|
default: pargs->err = ARGPARSE_PRINT_ERROR; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,11 +276,11 @@ int
|
|||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
gpg_error_t err, firsterr;
|
gpg_error_t err, firsterr;
|
||||||
ARGPARSE_ARGS pargs;
|
gpgrt_argparse_t pargs;
|
||||||
enum cmd_and_opt_values cmd;
|
enum cmd_and_opt_values cmd;
|
||||||
|
|
||||||
gnupg_reopen_std ("gpg-wks-server");
|
gnupg_reopen_std ("gpg-wks-server");
|
||||||
set_strusage (my_strusage);
|
gpgrt_set_strusage (my_strusage);
|
||||||
log_set_prefix ("gpg-wks-server", GPGRT_LOG_WITH_PREFIX);
|
log_set_prefix ("gpg-wks-server", GPGRT_LOG_WITH_PREFIX);
|
||||||
|
|
||||||
/* Make sure that our subsystems are ready. */
|
/* Make sure that our subsystems are ready. */
|
||||||
@ -291,6 +291,7 @@ main (int argc, char **argv)
|
|||||||
pargs.argv = &argv;
|
pargs.argv = &argv;
|
||||||
pargs.flags = ARGPARSE_FLAG_KEEP;
|
pargs.flags = ARGPARSE_FLAG_KEEP;
|
||||||
cmd = parse_arguments (&pargs, opts);
|
cmd = parse_arguments (&pargs, opts);
|
||||||
|
gpgrt_argparse (NULL, &pargs, NULL);
|
||||||
|
|
||||||
if (log_get_errorcount (0))
|
if (log_get_errorcount (0))
|
||||||
exit (2);
|
exit (2);
|
||||||
@ -420,7 +421,7 @@ main (int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
usage (1);
|
gpgrt_usage (1);
|
||||||
err = gpg_error (GPG_ERR_BUG);
|
err = gpg_error (GPG_ERR_BUG);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -16,12 +16,11 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
/* We don't want to have the macros from gpgrt here until we have
|
|
||||||
* completely replaced this module by the one from gpgrt. */
|
|
||||||
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -34,7 +33,6 @@
|
|||||||
#include "../common/sysutils.h"
|
#include "../common/sysutils.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
#include "../common/status.h"
|
#include "../common/status.h"
|
||||||
#include "../common/argparse.h" /* temporary hack. */
|
|
||||||
|
|
||||||
|
|
||||||
/* Constants to identify the commands and options. */
|
/* Constants to identify the commands and options. */
|
||||||
@ -74,7 +72,7 @@ enum cmd_and_opt_values
|
|||||||
|
|
||||||
|
|
||||||
/* The list of commands and options. */
|
/* The list of commands and options. */
|
||||||
static ARGPARSE_OPTS opts[] =
|
static gpgrt_opt_t opts[] =
|
||||||
{
|
{
|
||||||
{ 300, NULL, 0, N_("@Commands:\n ") },
|
{ 300, NULL, 0, N_("@Commands:\n ") },
|
||||||
|
|
||||||
@ -133,9 +131,11 @@ my_strusage( int level )
|
|||||||
|
|
||||||
switch (level)
|
switch (level)
|
||||||
{
|
{
|
||||||
|
case 9: p = "GPL-3.0-or-later"; break;
|
||||||
case 11: p = "@GPGCONF@ (@GNUPG@)";
|
case 11: p = "@GPGCONF@ (@GNUPG@)";
|
||||||
break;
|
break;
|
||||||
case 13: p = VERSION; break;
|
case 13: p = VERSION; break;
|
||||||
|
case 14: p = GNUPG_DEF_COPYRIGHT_LINE; break;
|
||||||
case 17: p = PRINTABLE_OS_NAME; break;
|
case 17: p = PRINTABLE_OS_NAME; break;
|
||||||
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
||||||
|
|
||||||
@ -541,7 +541,7 @@ int
|
|||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
ARGPARSE_ARGS pargs;
|
gpgrt_argparse_t pargs;
|
||||||
const char *fname;
|
const char *fname;
|
||||||
int no_more_options = 0;
|
int no_more_options = 0;
|
||||||
enum cmd_and_opt_values cmd = 0;
|
enum cmd_and_opt_values cmd = 0;
|
||||||
@ -550,7 +550,7 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
early_system_init ();
|
early_system_init ();
|
||||||
gnupg_reopen_std (GPGCONF_NAME);
|
gnupg_reopen_std (GPGCONF_NAME);
|
||||||
set_strusage (my_strusage);
|
gpgrt_set_strusage (my_strusage);
|
||||||
log_set_prefix (GPGCONF_NAME, GPGRT_LOG_WITH_PREFIX);
|
log_set_prefix (GPGCONF_NAME, GPGRT_LOG_WITH_PREFIX);
|
||||||
|
|
||||||
/* Make sure that our subsystems are ready. */
|
/* Make sure that our subsystems are ready. */
|
||||||
@ -561,17 +561,15 @@ main (int argc, char **argv)
|
|||||||
/* Parse the command line. */
|
/* Parse the command line. */
|
||||||
pargs.argc = &argc;
|
pargs.argc = &argc;
|
||||||
pargs.argv = &argv;
|
pargs.argv = &argv;
|
||||||
pargs.flags = 1; /* Do not remove the args. */
|
pargs.flags = ARGPARSE_FLAG_KEEP;
|
||||||
while (!no_more_options && optfile_parse (NULL, NULL, NULL, &pargs, opts))
|
while (!no_more_options && gpgrt_argparse (NULL, &pargs, opts))
|
||||||
{
|
{
|
||||||
switch (pargs.r_opt)
|
switch (pargs.r_opt)
|
||||||
{
|
{
|
||||||
case oOutput: opt.outfile = pargs.r.ret_str; break;
|
case oOutput: opt.outfile = pargs.r.ret_str; break;
|
||||||
case oQuiet: opt.quiet = 1; break;
|
case oQuiet: opt.quiet = 1; break;
|
||||||
case oDryRun: opt.dry_run = 1; break;
|
case oDryRun: opt.dry_run = 1; break;
|
||||||
case oRuntime:
|
case oRuntime: opt.runtime = 1; break;
|
||||||
opt.runtime = 1;
|
|
||||||
break;
|
|
||||||
case oVerbose: opt.verbose++; break;
|
case oVerbose: opt.verbose++; break;
|
||||||
case oNoVerbose: opt.verbose = 0; break;
|
case oNoVerbose: opt.verbose = 0; break;
|
||||||
case oHomedir: gnupg_set_homedir (pargs.r.ret_str); break;
|
case oHomedir: gnupg_set_homedir (pargs.r.ret_str); break;
|
||||||
@ -605,6 +603,8 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gpgrt_argparse (NULL, &pargs, NULL); /* Release internal state. */
|
||||||
|
|
||||||
if (log_get_errorcount (0))
|
if (log_get_errorcount (0))
|
||||||
gpgconf_failure (GPG_ERR_USER_2);
|
gpgconf_failure (GPG_ERR_USER_2);
|
||||||
|
|
||||||
|
@ -15,12 +15,11 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
/* We don't want to have the macros from gpgrt here until we have
|
|
||||||
* completely replaced this module by the one from gpgrt. */
|
|
||||||
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -42,7 +41,6 @@
|
|||||||
#define INCLUDED_BY_MAIN_MODULE 1
|
#define INCLUDED_BY_MAIN_MODULE 1
|
||||||
#include "../common/util.h"
|
#include "../common/util.h"
|
||||||
#include "../common/openpgpdefs.h"
|
#include "../common/openpgpdefs.h"
|
||||||
#include "../common/argparse.h" /* temporary hack. */
|
|
||||||
|
|
||||||
#ifdef HAVE_BZIP2
|
#ifdef HAVE_BZIP2
|
||||||
# include <bzlib.h>
|
# include <bzlib.h>
|
||||||
@ -70,7 +68,7 @@ enum cmd_and_opt_values {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static ARGPARSE_OPTS opts[] = {
|
static gpgrt_opt_t opts[] = {
|
||||||
|
|
||||||
{ 301, NULL, 0, "@Options:\n " },
|
{ 301, NULL, 0, "@Options:\n " },
|
||||||
|
|
||||||
@ -90,9 +88,11 @@ my_strusage (int level)
|
|||||||
const char *p;
|
const char *p;
|
||||||
switch (level)
|
switch (level)
|
||||||
{
|
{
|
||||||
|
case 9: p = "GPL-3.0-or-later"; break;
|
||||||
case 11: p = "gpgsplit (@GNUPG@)";
|
case 11: p = "gpgsplit (@GNUPG@)";
|
||||||
break;
|
break;
|
||||||
case 13: p = VERSION; break;
|
case 13: p = VERSION; break;
|
||||||
|
case 14: p = GNUPG_DEF_COPYRIGHT_LINE; break;
|
||||||
case 17: p = PRINTABLE_OS_NAME; break;
|
case 17: p = PRINTABLE_OS_NAME; break;
|
||||||
case 19: p = "Please report bugs to <@EMAIL@>.\n"; break;
|
case 19: p = "Please report bugs to <@EMAIL@>.\n"; break;
|
||||||
|
|
||||||
@ -115,19 +115,22 @@ my_strusage (int level)
|
|||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
ARGPARSE_ARGS pargs;
|
gpgrt_argparse_t pargs;
|
||||||
|
|
||||||
#ifdef HAVE_DOSISH_SYSTEM
|
#ifdef HAVE_DOSISH_SYSTEM
|
||||||
setmode( fileno(stdin), O_BINARY );
|
setmode( fileno(stdin), O_BINARY );
|
||||||
setmode( fileno(stdout), O_BINARY );
|
setmode( fileno(stdout), O_BINARY );
|
||||||
#endif
|
#endif
|
||||||
log_set_prefix ("gpgsplit", GPGRT_LOG_WITH_PREFIX);
|
log_set_prefix ("gpgsplit", GPGRT_LOG_WITH_PREFIX);
|
||||||
set_strusage (my_strusage);
|
gpgrt_set_strusage (my_strusage);
|
||||||
|
/* Register our string mapper with gpgrt. Usually done in
|
||||||
|
* init_common_subsystems, but we don't need that here. */
|
||||||
|
gpgrt_set_fixed_string_mapper (map_static_macro_string);
|
||||||
|
|
||||||
pargs.argc = &argc;
|
pargs.argc = &argc;
|
||||||
pargs.argv = &argv;
|
pargs.argv = &argv;
|
||||||
pargs.flags= 1; /* do not remove the args */
|
pargs.flags= ARGPARSE_FLAG_KEEP;
|
||||||
while (optfile_parse( NULL, NULL, NULL, &pargs, opts))
|
while (gpgrt_argparse (NULL, &pargs, opts))
|
||||||
{
|
{
|
||||||
switch (pargs.r_opt)
|
switch (pargs.r_opt)
|
||||||
{
|
{
|
||||||
@ -139,6 +142,7 @@ main (int argc, char **argv)
|
|||||||
default : pargs.err = 2; break;
|
default : pargs.err = 2; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
gpgrt_argparse (NULL, &pargs, NULL); /* Release internal state. */
|
||||||
|
|
||||||
if (log_get_errorcount(0))
|
if (log_get_errorcount(0))
|
||||||
g10_exit (2);
|
g10_exit (2);
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* GnuPG comes with a shell script gpg-zip which creates archive files
|
/* GnuPG comes with a shell script gpg-zip which creates archive files
|
||||||
@ -27,9 +28,7 @@
|
|||||||
gpg. So here we go. */
|
gpg. So here we go. */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
/* We don't want to have the macros from gpgrt here until we have
|
|
||||||
* completely replaced this module by the one from gpgrt. */
|
|
||||||
#undef GPGRT_ENABLE_ARGPARSE_MACROS
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -44,7 +43,6 @@
|
|||||||
#include "../common/openpgpdefs.h"
|
#include "../common/openpgpdefs.h"
|
||||||
#include "../common/init.h"
|
#include "../common/init.h"
|
||||||
#include "../common/strlist.h"
|
#include "../common/strlist.h"
|
||||||
#include "../common/argparse.h" /* temporary hack. */
|
|
||||||
|
|
||||||
#include "gpgtar.h"
|
#include "gpgtar.h"
|
||||||
|
|
||||||
@ -88,7 +86,7 @@ enum cmd_and_opt_values
|
|||||||
|
|
||||||
|
|
||||||
/* The list of commands and options. */
|
/* The list of commands and options. */
|
||||||
static ARGPARSE_OPTS opts[] = {
|
static gpgrt_opt_t opts[] = {
|
||||||
ARGPARSE_group (300, N_("@Commands:\n ")),
|
ARGPARSE_group (300, N_("@Commands:\n ")),
|
||||||
|
|
||||||
ARGPARSE_c (aCreate, "create", N_("create an archive")),
|
ARGPARSE_c (aCreate, "create", N_("create an archive")),
|
||||||
@ -130,7 +128,7 @@ static ARGPARSE_OPTS opts[] = {
|
|||||||
|
|
||||||
|
|
||||||
/* The list of commands and options for tar that we understand. */
|
/* The list of commands and options for tar that we understand. */
|
||||||
static ARGPARSE_OPTS tar_opts[] = {
|
static gpgrt_opt_t tar_opts[] = {
|
||||||
ARGPARSE_s_s (oDirectory, "directory",
|
ARGPARSE_s_s (oDirectory, "directory",
|
||||||
N_("|DIRECTORY|extract files into DIRECTORY")),
|
N_("|DIRECTORY|extract files into DIRECTORY")),
|
||||||
ARGPARSE_s_s (oFilesFrom, "files-from",
|
ARGPARSE_s_s (oFilesFrom, "files-from",
|
||||||
@ -158,9 +156,11 @@ my_strusage( int level )
|
|||||||
|
|
||||||
switch (level)
|
switch (level)
|
||||||
{
|
{
|
||||||
|
case 9: p = "GPL-3.0-or-later"; break;
|
||||||
case 11: p = "@GPGTAR@ (@GNUPG@)";
|
case 11: p = "@GPGTAR@ (@GNUPG@)";
|
||||||
break;
|
break;
|
||||||
case 13: p = VERSION; break;
|
case 13: p = VERSION; break;
|
||||||
|
case 14: p = GNUPG_DEF_COPYRIGHT_LINE; break;
|
||||||
case 17: p = PRINTABLE_OS_NAME; break;
|
case 17: p = PRINTABLE_OS_NAME; break;
|
||||||
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
|
||||||
|
|
||||||
@ -307,11 +307,11 @@ shell_parse_argv (const char *s, int *r_argc, char ***r_argv)
|
|||||||
|
|
||||||
/* Command line parsing. */
|
/* Command line parsing. */
|
||||||
static void
|
static void
|
||||||
parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)
|
parse_arguments (gpgrt_argparse_t *pargs, gpgrt_opt_t *popts)
|
||||||
{
|
{
|
||||||
int no_more_options = 0;
|
int no_more_options = 0;
|
||||||
|
|
||||||
while (!no_more_options && optfile_parse (NULL, NULL, NULL, pargs, popts))
|
while (!no_more_options && gpgrt_argparse (NULL, pargs, popts))
|
||||||
{
|
{
|
||||||
switch (pargs->r_opt)
|
switch (pargs->r_opt)
|
||||||
{
|
{
|
||||||
@ -381,7 +381,7 @@ parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case oTarArgs:;
|
case oTarArgs:
|
||||||
{
|
{
|
||||||
int tar_argc;
|
int tar_argc;
|
||||||
char **tar_argv;
|
char **tar_argv;
|
||||||
@ -391,11 +391,12 @@ parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)
|
|||||||
pargs->r.ret_str);
|
pargs->r.ret_str);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ARGPARSE_ARGS tar_args;
|
gpgrt_argparse_t tar_args;
|
||||||
tar_args.argc = &tar_argc;
|
tar_args.argc = &tar_argc;
|
||||||
tar_args.argv = &tar_argv;
|
tar_args.argv = &tar_argv;
|
||||||
tar_args.flags = ARGPARSE_FLAG_ARG0;
|
tar_args.flags = ARGPARSE_FLAG_ARG0;
|
||||||
parse_arguments (&tar_args, tar_opts);
|
parse_arguments (&tar_args, tar_opts);
|
||||||
|
gpgrt_argparse (NULL, &tar_args, NULL);
|
||||||
if (tar_args.err)
|
if (tar_args.err)
|
||||||
log_error ("unsupported tar arguments '%s'\n",
|
log_error ("unsupported tar arguments '%s'\n",
|
||||||
pargs->r.ret_str);
|
pargs->r.ret_str);
|
||||||
@ -420,23 +421,24 @@ main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
const char *fname;
|
const char *fname;
|
||||||
ARGPARSE_ARGS pargs;
|
gpgrt_argparse_t pargs;
|
||||||
|
|
||||||
assert (sizeof (struct ustar_raw_header) == 512);
|
|
||||||
|
|
||||||
gnupg_reopen_std (GPGTAR_NAME);
|
gnupg_reopen_std (GPGTAR_NAME);
|
||||||
set_strusage (my_strusage);
|
gpgrt_set_strusage (my_strusage);
|
||||||
log_set_prefix (GPGTAR_NAME, GPGRT_LOG_WITH_PREFIX);
|
log_set_prefix (GPGTAR_NAME, GPGRT_LOG_WITH_PREFIX);
|
||||||
|
|
||||||
/* Make sure that our subsystems are ready. */
|
/* Make sure that our subsystems are ready. */
|
||||||
i18n_init();
|
i18n_init();
|
||||||
init_common_subsystems (&argc, &argv);
|
init_common_subsystems (&argc, &argv);
|
||||||
|
|
||||||
|
log_assert (sizeof (struct ustar_raw_header) == 512);
|
||||||
|
|
||||||
/* Parse the command line. */
|
/* Parse the command line. */
|
||||||
pargs.argc = &argc;
|
pargs.argc = &argc;
|
||||||
pargs.argv = &argv;
|
pargs.argv = &argv;
|
||||||
pargs.flags = ARGPARSE_FLAG_KEEP;
|
pargs.flags = ARGPARSE_FLAG_KEEP;
|
||||||
parse_arguments (&pargs, opts);
|
parse_arguments (&pargs, opts);
|
||||||
|
gpgrt_argparse (NULL, &pargs, NULL);
|
||||||
|
|
||||||
if ((files_from && !null_names) || (!files_from && null_names))
|
if ((files_from && !null_names) || (!files_from && null_names))
|
||||||
log_error ("--files-from and --null may only be used in conjunction\n");
|
log_error ("--files-from and --null may only be used in conjunction\n");
|
||||||
@ -466,7 +468,7 @@ main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
case aList:
|
case aList:
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
usage (1);
|
gpgrt_usage (1);
|
||||||
fname = argc ? *argv : NULL;
|
fname = argc ? *argv : NULL;
|
||||||
if (opt.filename)
|
if (opt.filename)
|
||||||
log_info ("note: ignoring option --set-filename\n");
|
log_info ("note: ignoring option --set-filename\n");
|
||||||
@ -482,7 +484,7 @@ main (int argc, char **argv)
|
|||||||
case aSignEncrypt:
|
case aSignEncrypt:
|
||||||
if ((!argc && !null_names)
|
if ((!argc && !null_names)
|
||||||
|| (argc && null_names))
|
|| (argc && null_names))
|
||||||
usage (1);
|
gpgrt_usage (1);
|
||||||
if (opt.filename)
|
if (opt.filename)
|
||||||
log_info ("note: ignoring option --set-filename\n");
|
log_info ("note: ignoring option --set-filename\n");
|
||||||
err = gpgtar_create (null_names? NULL :argv,
|
err = gpgtar_create (null_names? NULL :argv,
|
||||||
@ -495,7 +497,7 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
case aDecrypt:
|
case aDecrypt:
|
||||||
if (argc != 1)
|
if (argc != 1)
|
||||||
usage (1);
|
gpgrt_usage (1);
|
||||||
if (opt.outfile)
|
if (opt.outfile)
|
||||||
log_info ("note: ignoring option --output\n");
|
log_info ("note: ignoring option --output\n");
|
||||||
if (files_from)
|
if (files_from)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user