|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
File autogenerated by gengetopt version 2.22
|
|
|
|
|
File autogenerated by gengetopt version 2.22.2
|
|
|
|
|
generated with the following command:
|
|
|
|
|
gengetopt --unamed-opts=ES-FILE -F esmtool_cmd -G
|
|
|
|
|
|
|
|
|
@ -17,6 +17,10 @@
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
#ifndef FIX_UNUSED
|
|
|
|
|
#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "esmtool_cmd.h"
|
|
|
|
|
|
|
|
|
@ -65,6 +69,7 @@ void clear_given (struct gengetopt_args_info *args_info)
|
|
|
|
|
static
|
|
|
|
|
void clear_args (struct gengetopt_args_info *args_info)
|
|
|
|
|
{
|
|
|
|
|
FIX_UNUSED (args_info);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -84,7 +89,9 @@ void init_args_info(struct gengetopt_args_info *args_info)
|
|
|
|
|
void
|
|
|
|
|
cmdline_parser_print_version (void)
|
|
|
|
|
{
|
|
|
|
|
printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
|
|
|
|
|
printf ("%s %s\n",
|
|
|
|
|
(strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
|
|
|
|
|
CMDLINE_PARSER_VERSION);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void print_help_common(void) {
|
|
|
|
@ -99,7 +106,7 @@ static void print_help_common(void) {
|
|
|
|
|
printf("\n");
|
|
|
|
|
|
|
|
|
|
if (strlen(gengetopt_args_info_description) > 0)
|
|
|
|
|
printf("%s\n", gengetopt_args_info_description);
|
|
|
|
|
printf("%s\n\n", gengetopt_args_info_description);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -118,7 +125,7 @@ cmdline_parser_init (struct gengetopt_args_info *args_info)
|
|
|
|
|
clear_args (args_info);
|
|
|
|
|
init_args_info (args_info);
|
|
|
|
|
|
|
|
|
|
args_info->inputs = NULL;
|
|
|
|
|
args_info->inputs = 0;
|
|
|
|
|
args_info->inputs_num = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -163,8 +170,9 @@ cmdline_parser_release (struct gengetopt_args_info *args_info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
|
|
|
|
|
write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
|
|
|
|
|
{
|
|
|
|
|
FIX_UNUSED (values);
|
|
|
|
|
if (arg) {
|
|
|
|
|
fprintf(outfile, "%s=\"%s\"\n", opt, arg);
|
|
|
|
|
} else {
|
|
|
|
@ -230,7 +238,7 @@ cmdline_parser_free (struct gengetopt_args_info *args_info)
|
|
|
|
|
char *
|
|
|
|
|
gengetopt_strdup (const char *s)
|
|
|
|
|
{
|
|
|
|
|
char *result = NULL;
|
|
|
|
|
char *result = 0;
|
|
|
|
|
if (!s)
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
@ -252,7 +260,7 @@ cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *ar
|
|
|
|
|
struct cmdline_parser_params *params)
|
|
|
|
|
{
|
|
|
|
|
int result;
|
|
|
|
|
result = cmdline_parser_internal (argc, argv, args_info, params, NULL);
|
|
|
|
|
result = cmdline_parser_internal (argc, argv, args_info, params, 0);
|
|
|
|
|
|
|
|
|
|
if (result == EXIT_FAILURE)
|
|
|
|
|
{
|
|
|
|
@ -275,7 +283,7 @@ cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_
|
|
|
|
|
params.check_ambiguity = 0;
|
|
|
|
|
params.print_errors = 1;
|
|
|
|
|
|
|
|
|
|
result = cmdline_parser_internal (argc, argv, args_info, ¶ms, NULL);
|
|
|
|
|
result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0);
|
|
|
|
|
|
|
|
|
|
if (result == EXIT_FAILURE)
|
|
|
|
|
{
|
|
|
|
@ -289,6 +297,8 @@ cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_
|
|
|
|
|
int
|
|
|
|
|
cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
|
|
|
|
|
{
|
|
|
|
|
FIX_UNUSED (args_info);
|
|
|
|
|
FIX_UNUSED (prog_name);
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -322,37 +332,6 @@ struct option
|
|
|
|
|
int val;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* For communication from `getopt' to the caller.
|
|
|
|
|
When `getopt' finds an option that takes an argument,
|
|
|
|
|
the argument value is returned here.
|
|
|
|
|
Also, when `ordering' is RETURN_IN_ORDER,
|
|
|
|
|
each non-option ARGV-element is returned here. */
|
|
|
|
|
|
|
|
|
|
static char *optarg;
|
|
|
|
|
|
|
|
|
|
/* Index in ARGV of the next element to be scanned.
|
|
|
|
|
This is used for communication to and from the caller
|
|
|
|
|
and for communication between successive calls to `getopt'.
|
|
|
|
|
|
|
|
|
|
On entry to `getopt', zero means this is the first call; initialize.
|
|
|
|
|
|
|
|
|
|
When `getopt' returns -1, this is the index of the first of the
|
|
|
|
|
non-option elements that the caller should itself scan.
|
|
|
|
|
|
|
|
|
|
Otherwise, `optind' communicates from one call to the next
|
|
|
|
|
how much of ARGV has been scanned so far. */
|
|
|
|
|
|
|
|
|
|
static int optind;
|
|
|
|
|
|
|
|
|
|
/* Callers store zero here to inhibit the error message `getopt' prints
|
|
|
|
|
for unrecognized options. */
|
|
|
|
|
|
|
|
|
|
static int opterr;
|
|
|
|
|
|
|
|
|
|
/* Set to an option character which was unrecognized. */
|
|
|
|
|
|
|
|
|
|
static int optopt;
|
|
|
|
|
|
|
|
|
|
/* This version of `getopt' appears to the caller like standard Unix `getopt'
|
|
|
|
|
but it behaves differently for the user, since it allows the user
|
|
|
|
|
to intersperse the options with the other arguments.
|
|
|
|
@ -734,7 +713,7 @@ static int check_short_opt(int argc, char *const *argv, const char *optstring,
|
|
|
|
|
int print_errors, struct custom_getopt_data *d)
|
|
|
|
|
{
|
|
|
|
|
char c = *d->nextchar++;
|
|
|
|
|
char *temp = strchr(optstring, c);
|
|
|
|
|
const char *temp = strchr(optstring, c);
|
|
|
|
|
|
|
|
|
|
/* Increment `custom_optind' when we start to process its last character. */
|
|
|
|
|
if (*d->nextchar == '\0')
|
|
|
|
@ -939,13 +918,15 @@ static char *package_name = 0;
|
|
|
|
|
static
|
|
|
|
|
int update_arg(void *field, char **orig_field,
|
|
|
|
|
unsigned int *field_given, unsigned int *prev_given,
|
|
|
|
|
char *value, char *possible_values[], const char *default_value,
|
|
|
|
|
char *value, const char *possible_values[],
|
|
|
|
|
const char *default_value,
|
|
|
|
|
cmdline_parser_arg_type arg_type,
|
|
|
|
|
int check_ambiguity, int override,
|
|
|
|
|
int no_free, int multiple_option,
|
|
|
|
|
const char *long_opt, char short_opt,
|
|
|
|
|
const char *additional_error)
|
|
|
|
|
{
|
|
|
|
|
FIX_UNUSED (field);
|
|
|
|
|
char *stop_char = 0;
|
|
|
|
|
const char *val = value;
|
|
|
|
|
int found;
|
|
|
|
@ -966,6 +947,7 @@ int update_arg(void *field, char **orig_field,
|
|
|
|
|
return 1; /* failure */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FIX_UNUSED (default_value);
|
|
|
|
|
|
|
|
|
|
if (field_given && *field_given && ! override)
|
|
|
|
|
return 0;
|
|
|
|
@ -1003,7 +985,8 @@ int update_arg(void *field, char **orig_field,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
|
|
|
|
|
cmdline_parser_internal (
|
|
|
|
|
int argc, char * const *argv, struct gengetopt_args_info *args_info,
|
|
|
|
|
struct cmdline_parser_params *params, const char *additional_error)
|
|
|
|
|
{
|
|
|
|
|
int c; /* Character of the parsed option. */
|
|
|
|
@ -1015,6 +998,11 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf
|
|
|
|
|
int initialize;
|
|
|
|
|
int check_required;
|
|
|
|
|
int check_ambiguity;
|
|
|
|
|
|
|
|
|
|
char *optarg;
|
|
|
|
|
int optind;
|
|
|
|
|
int opterr;
|
|
|
|
|
int optopt;
|
|
|
|
|
|
|
|
|
|
package_name = argv[0];
|
|
|
|
|
|
|
|
|
@ -1043,7 +1031,7 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf
|
|
|
|
|
{ "raw", 0, NULL, 'r' },
|
|
|
|
|
{ "quiet", 0, NULL, 'q' },
|
|
|
|
|
{ "loadcells", 0, NULL, 'C' },
|
|
|
|
|
{ NULL, 0, NULL, 0 }
|
|
|
|
|
{ 0, 0, 0, 0 }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
custom_optarg = optarg;
|
|
|
|
|