CVS patchset: 1889
CVS date: 1997/11/02 22:49:50
char * appName;
struct poptAlias * aliases;
int numAliases;
+ int flags;
};
poptContext poptGetContext(char * name ,int argc, char ** argv,
con->os->currAlias = NULL;
con->os->nextCharArg = NULL;
con->os->nextArg = NULL;
- con->os->next = 1; /* skip argv[0] */
+
+ if (flags & POPT_KEEP_FIRST)
+ con->os->next = 0; /* include argv[0] */
+ else
+ con->os->next = 1; /* skip argv[0] */
con->leftovers = malloc(sizeof(char *) * (argc + 1));
con->numLeftovers = 0;
con->options = options;
con->aliases = NULL;
con->numAliases = 0;
+ con->flags = 0;
if (!name)
con->appName = NULL;
#define POPT_ERROR_BADNUMBER -17
#define POPT_ERROR_OVERFLOW -18
+/* context creation flags */
#define POPT_BADOPTION_NOALIAS (1 << 0) /* don't go into an alias */
+#define POPT_KEEP_FIRST (1 << 1) /* pay attention to argv[0] */
struct poptOption {
const char * longName; /* may be NULL */