aboutsummaryrefslogtreecommitdiff
path: root/libshouldbeinlibc/argp-parse.c
Commit message (Collapse)AuthorAgeFilesLines
* [_LIBC] <libc-lock.h> -> <bits/libc-lock.h>.Miles Bader1997-07-031-1/+1
|
* (parser_parse_opt):Miles Bader1997-06-181-35/+91
| | | | | | | | | | | | | | | | | | Detect and report unhandled options here. (parser_finalize): Do another pass over the parsers with ARGP_KEY_FINI. (argp_default_options, argp_version_options): Wrap doc strings in N_(). (argp_version_parser): Include `(PROGRAM ERROR)' in the no-version error text to indicate that something's fucked. (parser_parse_arg): Handle ARGP_KEY_ARGS here. Adjust NEXT pointer back if we fail to parse anything. (parser_parse_next): Simplify arg code. Leave state NEXT frobbing to parser_parse_arg. [!_] (N_): New macro.
* Sync with libc version (there were minor whitespace differences, etc).Miles Bader1997-06-051-2/+2
|
* (parser_init):Miles Bader1997-05-261-1/+1
| | | | Replace references to STATE->argp with STATE->root_argp.
* (parser_init):Miles Bader1997-05-261-0/+8
| | | | | For the special case where no parsing function is supplied for an argp, propagate its input to its first child, if any.
* (parser_finalize): Always set *END_INDEX if supplied.Miles Bader1997-05-091-0/+4
|
* (parser_convert):Miles Bader1997-02-201-14/+21
| | | | | | | Add FLAGS argument back. (parser_init): Once again pass FLAGS argument to parser_convert. Initialize PARSER->state after calling parser_convert.
* Merge changes from libc 1997-02-17.Miles Bader1997-02-201-0/+1
|
* (parser_convert):Miles Bader1997-02-191-19/+20
| | | | | | | | Remove FLAGS argument & use PARSER->state.flags. (parser_init): Set PARSER->state.flags. Don't pass FLAGS argument to parser_convert. Make check whether PARSER has the prog name in argv[0] at the proper place.
* (parser_parse_next, parser_init):Miles Bader1997-02-171-13/+12
| | | | | | | | Remove __ prefixes from references to getopt functions and variables (OPT*). (argp_version_parser, parser_finalize): Use _ instead of gettext. (gettext): Macro removed.
* (struct group):Miles Bader1997-02-161-0/+26
| | | | | | | | | | Add argp field. (convert_options): Set it. (__argp_input): New function. (parser_init): Set PARSER->state.pstate.
* (parser_finalize, argp_version_parser):Miles Bader1997-02-141-2/+14
| | | | Call gettext in appropriate places.
* [HAVE_CONFIG_H] <config.h>: New include.Miles Bader1997-02-131-1/+5
|
* Update to libc-970212 versions.Miles Bader1997-02-131-18/+16
|
* (parser_parse_next):Miles Bader1997-02-121-37/+34
| | | | | | | Decrement PARSER->state.next if we consumed an arg we didn't end up parsing. Set ARG_EBADKEY ourselves in all cases. (parser_parse_arg, parser_parse_opt): Get rid of ARG_EBADKEY param.
* (__progname, __progname_full):Miles Bader1997-02-121-10/+8
| | | | | | | Decls removed. (argp_default_parser): Use PROGRAM_INVOCATION_NAME & PROGRAM_INVOCATION_SHORT_NAME instead of __PROGNAME_FULL & __PROGNAME.
* (__argp_parse): Renamed from argp_parse.Miles Bader1997-02-121-10/+13
| | | | | | | | | [weak_alias] (argp_parse): New weak alias. (argp_default_parser, parser_finalize): Use __argp_state_help, not argp_state_help. (argp_version_parser): Use __argp_error, not argp_error. (convert_options, calc_sizes): Use __option_is_end, not _option_is_end. (convert_options): Use __option_is_short, not _option_is_short.
* Largely rewritten to clean up the code, avoid using nested functions, andMiles Bader1997-02-121-375/+536
| | | | adapt namespace and locking in preparation for moving into libc.
* (argp_default_parser):Miles Bader1997-02-111-5/+5
| | | | | | Use strrchr instead of rindex. (argp_parse): Use strchr instead of index, memset instead of bzero.
* (argp_parse):Miles Bader1997-02-091-34/+44
| | | | | Support ARGP_LONG_ONLY. Don't parse OPTION_DOC options.
* (argp_parse):Miles Bader1996-10-241-13/+15
| | | | Convert to use the new type of argp children vectors.
* (argp_parse):Miles Bader1996-10-151-1/+4
| | | | | | Don't consume non-option arguments that aren't recognized by any parser. Allocate enough space for TOP_ARGP's parent list to include the version parser.
* (argp_version_options, argp_version_parser):Miles Bader1996-07-101-2/+2
| | | | Use an uppercase 'V' for short version option.
* (argp_version_parser):Miles Bader1996-07-061-2/+2
| | | | | Output ARGP_PROGRAM_VERSION to STATE->out_stream, not stdout. Supply that stream and STATE to ARGP_PROGRAM_VERSION_HOOK.
* (argp_parse): Zero the CHILD_INPUTS vector.Miles Bader1996-06-271-0/+2
|
* (argp_parse):Miles Bader1996-06-211-2/+3
| | | | Use group_parse instead of calling group parser directly for long options.
* (argp_parse): Handle null streams.Miles Bader1996-06-171-1/+1
|
* (argp_default_parser): Output to STATE->out_stream.Miles Bader1996-06-171-6/+13
| | | | | (argp_parse): Initialize new fields in STATE. Output errors to STATE.err_stream.
* (argp_default_parser): Break after --HANG.Miles Bader1996-05-231-0/+1
|
* (argp_parse): Only print a `Try...' message if the error was a parsing error.Miles Bader1996-05-221-1/+2
|
* (argp_parse): Turn any EBADKEY that makes it to the end back into EINVAL.Miles Bader1996-05-111-0/+3
|
* ARGP_ERR_UNKNOWN_KEY --> ARGP_ERR_UNKNOWN.Miles Bader1996-05-111-2/+2
|
* (EBADKEY): New define.Miles Bader1996-05-111-29/+32
| | | | | (argp_default_parser, argp_version_parser, argp_parse): Use EBADKEY instead of EINVAL.
* (_argp_hang): New variable.Miles Bader1996-05-021-1/+49
| | | | | | | | (OPT_HANG): New macro. (argp_default_options, argp_default_parser): Add hidden --HANG option. (argp_default_parser): New function. (argp_version_options, argp_version_argp): New variables. (argp_parse): Use ARGP_VERSION_ARGP when appropiate.
* (argp_parse): Work with ARGP == 0.Miles Bader1996-05-011-6/+12
|
* (argp_parse):Miles Bader1996-04-031-24/+20
| | | | | | | | | | | | Change HOOK argument to INPUT. Don't propagate back return values when we're done. (struct group): Rename HOOK & CHILD_HOOKS to INPUT & CHILD_INPUTS. Add HOOK field again. (group_parse): Restore & save value of GROUP's hook field into STATE around calling the parser. Don't save changed value of INPUT.
* (struct group): Add PARENT, PARENT_INDEX, HOOK, and CHILD_HOOKS fields.Miles Bader1996-03-191-36/+125
| | | | | | | | | | | | (argp_parse): Add HOOK argument. Implement passing hook values to parsers, and propagating them between parents and children. When printing `too many arguments', test ARGP_NO_ERRS, not ARGP_NO_HELP. (argp_default_options): Add --usage option. (argp_default_parser): Use argp_state_help, so we don't need to screw with exit options anymore. Add usage option.
* (argp_parse): Print an error message if appropiate when we know there are tooMiles Bader1996-02-291-1/+6
| | | | many arguments.
* (argp_parse): Correctly deal with errors from getopt, and allow the user toMiles Bader1996-02-151-29/+40
| | | | | | | use '?' as a short option. (KEY_ERR): New macro. (argp_default_options, argp_default_parser): Use -? as the short option for --help.
* (argp_parse):Miles Bader1996-02-141-55/+100
| | | | | | | | | | Don't parse args in order by default. Deal correctly when the user turns a non-option arg into an option in re-ordering mode. Honor ARGP_NO_ARGS. Use KEY_END, KEY_ARG, and QUOTE. (KEY_END): New macro, in place of EOF. (KEY_ARG, QUOTE): New macros.
* (argp_parse):Miles Bader1996-02-091-30/+49
| | | | | | | | | | When a non-option arg fails to be parsed with EINVAL, set ARG_EINVAL true, and leave ERR as is until just before we return. Put process_arg() in the right scope. Deal with getopt returning EOF early because of `--'. Make STATE.arg_num per-group. (struct group): Renamed process_arg field to args_processed (a count).
* (argp_parse): Implement the ARG_NUM field.Miles Bader1996-02-051-2/+5
|
* (argp_default_options, argp_default_argp, argp_parse, find_long_option):Miles Bader1996-02-051-12/+13
| | | | Add `const' where appropriate.
* (argp_default_options, argp_default_parser):Miles Bader1996-01-191-2/+20
| | | | | Add --program-name (hidden) option. (OPT_PROGNAME): New macro.
* (_argp_unlock_xxx): New function.Miles Bader1996-01-031-0/+9
|
* (argp_default_options): Put --help in group -1.Miles Bader1995-12-211-1/+1
|
* (argp_parse): Changes uses of the INDEX field in struct argp_state to use NEXT.Miles Bader1995-12-061-7/+7
|
* (argp_parse): If an option alias doesn't have a key, use the real key.Miles Bader1995-10-131-1/+1
|
* (argp_parse): Correctly mark short options as optional.Miles Bader1995-10-121-1/+1
|
* (argp_parse):Miles Bader1995-10-111-81/+97
| | | | | | | | | | | | | | Update STATE.argp when adding a wrapper to implement the --help option. In general, use the version of variables that are in STATE. Update STATE.index in the case where getopt returns EOF. Correctly translate options. (argp_default_parser, argp_parse): Rename uses of argp_usage* to argp_help*. (argp_parse): Deal with null parser or option fields. If an argp has neither a parser or any options, don't put it in GROUPS. Use comparison with EGROUP, rather than testing the parser field, the end test for iteration over GROUPS. (argp_parse): Pass in the right value for GROUPS to convert_options.