opts_cfg_t* options;
} StreamContext_T;
+static const char* Program_Name = NULL;
static entry_t* Options = NULL;
static entry_t* Arguments = NULL;
StreamContext_T ctx;
ctx.line_idx = 0;
ctx.col_idx = -1;
- ctx.arg_count = argc;
- ctx.arg_vect = argv;
+ ctx.arg_count = argc-1;
+ ctx.arg_vect = &argv[1];
ctx.options = opts;
(void)opts_next_char( &ctx ); /* Loads up the first char */
+ /* Record the program name */
+ Program_Name = argv[0];
+
/* Until we run out of characters */
while (ctx.current != EOF) {
opts_consume_ws( &ctx );
return ret;
}
+const char* opts_prog_name(void) {
+ return Program_Name;
+}
+
/*****************************************************************************/
static int opts_calc_padding(opts_cfg_t* opts) {
const char** opts_arguments(void);
+const char* opts_prog_name(void);
+
void opts_print_help(FILE* ofile, opts_cfg_t* opts);
#ifdef __cplusplus