home *** CD-ROM | disk | FTP | other *** search
- *** argtype.c.OLD Tue Mar 26 11:31:00 1991
- --- argtype.c Tue Mar 26 10:19:41 1991
- ***************
- *** 79,85 ****
- ** ^DESCRIPTION:
- ** Each of these converts a parameter value to the internal form, includ-
- ** ing validity checking. Their parameters and return values all behave
- ! ** similarly. One of these routines are called when an argunent of that
- ** particular type is matched by one of the argument parsing function in
- ** parseargs(3). When such an argument is matched, its argument transla-
- ** tion routines is invoked and is passed (1) the address of the argument
- --- 79,85 ----
- ** ^DESCRIPTION:
- ** Each of these converts a parameter value to the internal form, includ-
- ** ing validity checking. Their parameters and return values all behave
- ! ** similarly. One of these routines is called when an argument of that
- ** particular type is matched by one of the argument parsing function in
- ** parseargs(3). When such an argument is matched, its argument transla-
- ** tion routines is invoked and is passed (1) the address of the argument
- ***************
- *** 151,157 ****
- ** usage to be printed.
- **
- ** ArgDummy is used to force an item to show up in usage-messages but
- ! ** the item itself is never matched against any argumenmts from the
- ** command-line.
- **
- ** ArgEnd is used by amiga_args.c and vms_args.c to indicate an argument
- --- 151,157 ----
- ** usage to be printed.
- **
- ** ArgDummy is used to force an item to show up in usage-messages but
- ! ** the item itself is never matched against any arguments from the
- ** command-line.
- **
- ** ArgEnd is used by amiga_args.c and vms_args.c to indicate an argument
- *** doc/argdesc.inc.OLD Tue Mar 26 11:31:16 1991
- --- doc/argdesc.inc Tue Mar 26 11:01:10 1991
- ***************
- *** 22,28 ****
- .\"---------------------------------------------
- .IP "\fIargTypePtr_t ad_type;\fP"
- This field is a pointer to a type conversion function (such as the
- ! ones provided in \fIargtype\fP(3). The type conversion function is
- responsible for verifying the validity of the argument, allocating any
- necessary storage for its internal representation, and converting
- the command-line argument into its required internal form. The type
- --- 22,28 ----
- .\"---------------------------------------------
- .IP "\fIargTypePtr_t ad_type;\fP"
- This field is a pointer to a type conversion function (such as the
- ! ones provided in \fIargtype\fP(3)). The type conversion function is
- responsible for verifying the validity of the argument, allocating any
- necessary storage for its internal representation, and converting
- the command-line argument into its required internal form. The type
- ***************
- *** 41,57 ****
- pointer to a number, a boolean value, a string, a list, or anything
- else for which there exists a corresponding arg-type function to
- use in the \fIad_type\fP field. In the case of of \fIparseargs\fP(1) this
- ! field must be the name of the corresponding shell variable which eventually
- ! hold the value of the argument given on the command-line.
- .\"---------------------------------------------
- .IP "\fIconst char *ad_prompt;\fP"
- This field contains the long-name of the argument and an optional
- description (the description must be separated from the long-name by
- ! at least one whitespace characters and may optionally be enclosed in
- a set of balanced delimiters (such as parentheses, curly-braces,
- ! square-brackets, or angle-brackets. If the long-name contains any
- uppercase characters, then the substring of long-name consisting of
- ! all uppercase characters is used as the argument name and the entire
- ! long-name is used as the name of the argument-value (if a value my be
- supplied). The long-name may be matched by supplying a unique prefix
- ! of either the argument name or the argument-value name.
- --- 41,57 ----
- pointer to a number, a boolean value, a string, a list, or anything
- else for which there exists a corresponding arg-type function to
- use in the \fIad_type\fP field. In the case of of \fIparseargs\fP(1) this
- ! field must be the name of the corresponding shell variable which will
- ! eventually hold the value of the argument given on the command-line.
- .\"---------------------------------------------
- .IP "\fIconst char *ad_prompt;\fP"
- This field contains the long-name of the argument and an optional
- description (the description must be separated from the long-name by
- ! at least one whitespace character and may optionally be enclosed in
- a set of balanced delimiters (such as parentheses, curly-braces,
- ! square-brackets, or angle-brackets). If the long-name contains any
- uppercase characters, then the substring of long-name consisting of
- ! all uppercase characters is used as the argument keyword and the entire
- ! long-name is used as the name of the argument (if a value my be
- supplied). The long-name may be matched by supplying a unique prefix
- ! of either the argument keyword or the argument name.
- *** doc/argtype.man3.OLD Tue Mar 26 11:31:22 1991
- --- doc/argtype.man3 Tue Mar 26 10:24:42 1991
- ***************
- *** 34,41 ****
- .PP
- Each of these converts a parameter value to the internal form,
- including validity checking. Their parameters and return values
- ! all behave similarly. One of these routines are called when an
- ! argunent of that particular type is matched by one of the argument
- parsing function in \fIparseargs\fP(3). When such an argument is matched,
- its argument translation routines is invoked and is passed (1) the address of
- the argument descriptor for the matched argument, (2) the possible argument
- --- 34,41 ----
- .PP
- Each of these converts a parameter value to the internal form,
- including validity checking. Their parameters and return values
- ! all behave similarly. One of these routines is called when an
- ! argument of that particular type is matched by one of the argument
- parsing function in \fIparseargs\fP(3). When such an argument is matched,
- its argument translation routines is invoked and is passed (1) the address of
- the argument descriptor for the matched argument, (2) the possible argument
- ***************
- *** 50,56 ****
- the matched argument has the \s-1ARGVEC\s+1 flag enabled). If the argument is
- an \s-1ARGVEC\s+1 or \s-1ARGLIST\s+1 then the routine is responsible for
- allocating any space, copying the arg-flags to the value-specific flags, and
- ! setting the \s-1ARGCOPYF\fP flag for the value if it needs to be allocated
- as well.
-
- .SH "RETURN VALUE"
- --- 50,56 ----
- the matched argument has the \s-1ARGVEC\s+1 flag enabled). If the argument is
- an \s-1ARGVEC\s+1 or \s-1ARGLIST\s+1 then the routine is responsible for
- allocating any space, copying the arg-flags to the value-specific flags, and
- ! setting the \s-1ARGCOPYF\s+1 flag for the value if it needs to be allocated
- as well.
-
- .SH "RETURN VALUE"
- ***************
- *** 65,71 ****
- The conversion was successful but only \fIN\fP characters of the value
- were used, the remaining characters may still match other arguments.
-
- ! .SH "PSEUDO-TYPES"
- .PP
- .I ArgUsage
- is used to specify an argument that causes the command usage to be printed.
- --- 65,71 ----
- The conversion was successful but only \fIN\fP characters of the value
- were used, the remaining characters may still match other arguments.
-
- ! .SH "PSEUDO-TYPES: argUsage, argDummy, argEnd"
- .PP
- .I ArgUsage
- is used to specify an argument that causes the command usage to be printed.
- ***************
- *** 72,78 ****
-
- .I ArgDummy
- is used to force an item to show up in usage-messages but
- ! the item itself is never matched against any argumenmts from the
- command-line.
-
- .I ArgEnd
- --- 72,78 ----
-
- .I ArgDummy
- is used to force an item to show up in usage-messages but
- ! the item itself is never matched against any arguments from the
- command-line.
-
- .I ArgEnd
- ***************
- *** 82,88 ****
- These three are dummy functions. The routines themselves do nothing
- of importance, we just need to have their addresses available for
- identification in the corresponding command-line styles.
- ! .SH "STRING-TYPES"
- .PP
- \fIArgStr\fP is one of the few argument translation routines that actually
- uses the \fIcopyf\fP flag. If \fIcopyf\fP is true then the string is
- --- 82,88 ----
- These three are dummy functions. The routines themselves do nothing
- of importance, we just need to have their addresses available for
- identification in the corresponding command-line styles.
- ! .SH "STRING-TYPES: argStr"
- .PP
- \fIArgStr\fP is one of the few argument translation routines that actually
- uses the \fIcopyf\fP flag. If \fIcopyf\fP is true then the string is
- ***************
- *** 94,100 ****
-
- \fIArgStr\fP ensures that the very last item in a vector of strings (the one
- accessed as \f4vec.array[ vec.count ]\fP) will always be \s-1NULL\s+1.
- ! .SH "CHARACTER-TYPES"
- .PP
- .I ArgChar
- assigns the given character to the value referenced by \fIarg_valp(ad)\fP
- --- 94,100 ----
-
- \fIArgStr\fP ensures that the very last item in a vector of strings (the one
- accessed as \f4vec.array[ vec.count ]\fP) will always be \s-1NULL\s+1.
- ! .SH "CHARACTER-TYPES: argChar"
- .PP
- .I ArgChar
- assigns the given character to the value referenced by \fIarg_valp(ad)\fP
- ***************
- *** 109,125 ****
-
- Unlike \fIargStr\fP, \fIargChar\fP will translate character escape sequences
- such as `\\n' and `\\012'.
- ! .SH "INTEGER-TYPES"
- .PP
- Each of these functions converts the given string to the desired
- integral type. The value may be specified as an octal number by
- specifying the first digit to be 0. Similarly, If the first two
- characters are `0x' then the number is treated as hexadecimal.
- ! .SH "FLOATING-POINT-TYPES"
- .PP
- Each of these functions converts the given string to the desired
- floating-point type.
- ! .SH "BOOLEAN-TYPES"
- .PP
- \fIArgBool\fP and \fIargSBool\fP set a boolean value (if no value is given).
- \fIArgUBool\fP unsets a boolean value (if no value is given). \fIArgTBool\fP
- --- 109,125 ----
-
- Unlike \fIargStr\fP, \fIargChar\fP will translate character escape sequences
- such as `\\n' and `\\012'.
- ! .SH "INTEGER-TYPES: argInt, argShort, argLong"
- .PP
- Each of these functions converts the given string to the desired
- integral type. The value may be specified as an octal number by
- specifying the first digit to be 0. Similarly, If the first two
- characters are `0x' then the number is treated as hexadecimal.
- ! .SH "FLOATING-POINT-TYPES: argFloat, argDouble"
- .PP
- Each of these functions converts the given string to the desired
- floating-point type.
- ! .SH "BOOLEAN-TYPES: argBool, argSBool, argTBool, argUBool"
- .PP
- \fIArgBool\fP and \fIargSBool\fP set a boolean value (if no value is given).
- \fIArgUBool\fP unsets a boolean value (if no value is given). \fIArgTBool\fP
- ***************
- *** 148,154 ****
- The corresponding boolean flag is set to \s-1FALSE\s+1.
- .IP "``1'', ``+'', ``ON'', or ``TRUE''"
- The corresponding boolean flag is set to \s-1TRUE\s+1.
- ! .SH LIST TYPES
- .PP
- The \fIlistStr\fP argument translation routine is only intended for use
- on behalf of arguments that have the \s-1ARGLIST\s+1 flag enabled. It will
- --- 148,154 ----
- The corresponding boolean flag is set to \s-1FALSE\s+1.
- .IP "``1'', ``+'', ``ON'', or ``TRUE''"
- The corresponding boolean flag is set to \s-1TRUE\s+1.
- ! .SH "LIST TYPES: listStr"
- .PP
- The \fIlistStr\fP argument translation routine is only intended for use
- on behalf of arguments that have the \s-1ARGLIST\s+1 flag enabled. It will
- ***************
- *** 168,171 ****
- type of the items in the vector.
- .SH SEE ALSO
- .IR parseargs (3),
- ! .IR parseargs (1),
- --- 168,172 ----
- type of the items in the vector.
- .SH SEE ALSO
- .IR parseargs (3),
- ! .IR parseargs (3),
- ! .IR parsecntl (1),
- *** doc/env_args.inc.OLD Tue Mar 26 11:31:43 1991
- --- doc/env_args.inc Tue Mar 26 10:42:13 1991
- ***************
- *** 10,16 ****
- will be parsed for any "default" arguments before the command-line is parsed.
- The command-line will over-ride any options that are specified in this
- environment variable (except that \s-1ARGLIST\s+1s and \s-1ARGVEC\s+1s set in
- ! ``\s-1CMD_ARGS\s+1'' will be appended from the command-line
-
- It is important to note that the contents of the ``\s-1\fICMD\fP_ARGS\s+1''
- environment variable are NOT expanded by the shell and hence any special
- --- 10,17 ----
- will be parsed for any "default" arguments before the command-line is parsed.
- The command-line will over-ride any options that are specified in this
- environment variable (except that \s-1ARGLIST\s+1s and \s-1ARGVEC\s+1s set in
- ! ``\s-1CMD_ARGS\s+1'' will be appended from the command-line if they are
- ! selected).
-
- It is important to note that the contents of the ``\s-1\fICMD\fP_ARGS\s+1''
- environment variable are NOT expanded by the shell and hence any special
- *** doc/env_parse.inc.OLD Tue Mar 26 11:31:46 1991
- --- doc/env_parse.inc Tue Mar 26 10:46:48 1991
- ***************
- *** 25,31 ****
- Ignore any unrecognized or improperly specified command-line arguments
- and continue execution of the program. Normally, if an argument is
- unmatched (or is improperly specified), a usage message is printed
- ! program execution is terminated.
- .\"----------------------
- .IP "\fIOptsOnly\fP"
- Under UNIX, setting this flag will disable the parsing of long-option
- --- 25,31 ----
- Ignore any unrecognized or improperly specified command-line arguments
- and continue execution of the program. Normally, if an argument is
- unmatched (or is improperly specified), a usage message is printed
- ! and program execution is terminated.
- .\"----------------------
- .IP "\fIOptsOnly\fP"
- Under UNIX, setting this flag will disable the parsing of long-option
- ***************
- *** 53,65 ****
- considered to consist of one option and one positional argument.
- .\"----------------------
- .IP "\fICaseIgnore\fP"
- ! Setting this flag cause character-case to be ignored when attempting
- to match single-character argument names (i.e. causes "-i" and "-I"
- will be considered equivalent).
- .sp 4p
- .PP
- If the environment variable ``\s-1PARSECNTL\s+1'' is empty or
- ! undefined, then parsing behavior set by the programmer is used.
- If the programmer has not explicitly used
- .IR parsecntl (3)
- to modify the parsing behavior, then the default behavior will be
- --- 53,65 ----
- considered to consist of one option and one positional argument.
- .\"----------------------
- .IP "\fICaseIgnore\fP"
- ! Setting this flag causes character-case to be ignored when attempting
- to match single-character argument names (i.e. causes "-i" and "-I"
- will be considered equivalent).
- .sp 4p
- .PP
- If the environment variable ``\s-1PARSECNTL\s+1'' is empty or
- ! undefined, then the parsing behavior set by the programmer is used.
- If the programmer has not explicitly used
- .IR parsecntl (3)
- to modify the parsing behavior, then the default behavior will be
- *** doc/lib_bugs.inc.OLD Tue Mar 26 11:31:57 1991
- --- doc/lib_bugs.inc Tue Mar 26 11:13:04 1991
- ***************
- *** 7,13 ****
- When a non-multivalued argument appears more than once on the command-line
- then only the last value supplied is used. A problem occurs however in the
- following scenario: suppose `\fB\-s\fP' is an option that takes an optional
- ! string argument (nd suppose `\fB\-x\fP' is some boolean flag). Then if the
- following command-line is issued:
-
- .RS
- --- 7,13 ----
- When a non-multivalued argument appears more than once on the command-line
- then only the last value supplied is used. A problem occurs however in the
- following scenario: suppose `\fB\-s\fP' is an option that takes an optional
- ! string argument (and suppose `\fB\-x\fP' is some boolean flag). Then if the
- following command-line is issued:
-
- .RS
- *** doc/lparseargs3.inc.OLD Tue Mar 26 11:32:01 1991
- --- doc/lparseargs3.inc Tue Mar 26 10:54:24 1991
- ***************
- *** 4,7 ****
- .\"----------------------------------------------------------------------------
- .PP
- Given an ArgList and an argdesc array, \fIlparseargs\fP
- ! will parse arguments in a file in much the same manner as \fIparseargs\fP.
- --- 4,7 ----
- .\"----------------------------------------------------------------------------
- .PP
- Given an ArgList and an argdesc array, \fIlparseargs\fP
- ! will parse arguments in an ArgList in much the same manner as \fIparseargs\fP.
- *** doc/multivals.inc.OLD Tue Mar 26 11:32:05 1991
- --- doc/multivals.inc Tue Mar 26 11:08:39 1991
- ***************
- *** 22,35 ****
- ArgList structure. \s-1L_NEXT\s+1 returns the address of the next item in the
- list and \s-1L_STRING\s+1 returns the string-value of the current list-item.
- \s-1L_FLAGS\s+1 return the arg-flags for a given item in the list. With
- ! non-multivalued, only the flags in the argument descriptor are needed; lists
- ! and vectors however need a set of flags for each item they contain.
- ! Once an arg-list has been created, it may be deallocated using the function
- .I listFree.
- .I ListFree
- ! takes two parameters, the first of which is the address of the first item in
- ! the arg-list, and the second of which is a boolean value that is \s-1TRUE\s+1
- ! only if each value pointed to by each item should also be deallocated.
- .PP
- An alternative to argument-lists is argument vectors (or arg-vectors).
- Arg-vectors use the \s-1ARGVEC\s+1 flag instead of the \s-1ARGLIST\s+1 flag
- --- 22,35 ----
- ArgList structure. \s-1L_NEXT\s+1 returns the address of the next item in the
- list and \s-1L_STRING\s+1 returns the string-value of the current list-item.
- \s-1L_FLAGS\s+1 return the arg-flags for a given item in the list. With
- ! non-multivalued arguments, only the flags in the argument descriptor are
- ! needed; lists and vectors however need a set of flags for each item they
- ! contain. Once an arg-list has been created, it may be deallocated using
- ! the function
- .I listFree.
- .I ListFree
- ! takes one parameter: first of which is the address of the first item in
- ! the arg-list.
- .PP
- An alternative to argument-lists is argument vectors (or arg-vectors).
- Arg-vectors use the \s-1ARGVEC\s+1 flag instead of the \s-1ARGLIST\s+1 flag
- *** doc/parseargs.man1.OLD Tue Mar 26 11:32:11 1991
- --- doc/parseargs.man1 Tue Mar 26 10:34:35 1991
- ***************
- *** 188,194 ****
- the calling program is needed in order for \fBparseargs\fP to be able to
- distinguish options to itself from options for the calling program.
- .PP
- ! The default behavior of parseargs is allow both single-character options and
- long-options (keywords) on the command-line. The user may specify that only
- options (long-options) are to be permitted by specifying the \fB\-o\fP
- (\fB\-l\) option on the command-line.
- --- 188,194 ----
- the calling program is needed in order for \fBparseargs\fP to be able to
- distinguish options to itself from options for the calling program.
- .PP
- ! The default behavior of parseargs is to allow both single-character options and
- long-options (keywords) on the command-line. The user may specify that only
- options (long-options) are to be permitted by specifying the \fB\-o\fP
- (\fB\-l\) option on the command-line.
- *** doc/parseargs.man3.OLD Tue Mar 26 11:32:16 1991
- --- doc/parseargs.man3 Tue Mar 26 11:12:33 1991
- ***************
- *** 12,18 ****
- int fparseargs( FILE *fp, ARGDESC *argd )
- int lparseargs( ArgList *argls, ARGDESC *argd )
- int sparseargs( char *str, ARGDESC *argd )
- ! int vparseargs( ARGDESC *argd, ... )
- void usage( const ARGDESC *argd )
- .fi
- .\"-----------------------------------------------------------
- --- 12,18 ----
- int fparseargs( FILE *fp, ARGDESC *argd )
- int lparseargs( ArgList *argls, ARGDESC *argd )
- int sparseargs( char *str, ARGDESC *argd )
- ! int vparseargs( ARGDESC *argd, int argc, ... )
- void usage( const ARGDESC *argd )
- .fi
- .\"-----------------------------------------------------------
- ***************
- *** 122,134 ****
- Its main use is to find the location in which to store the converted value,
- located in argd\(->ad_valp.
- The string value to be converted is passed in
- ! .IR argp
- (which will be \s-1NULL\s+1 if the \s-1ARGNOVAL\s+1 flag was set for the
- corresponding entry in the arg-descriptor table).
- The
- .I copyf
- flag is TRUE if the
- ! .I argp
- string value must be copied when saved.
- Most non-string types are copied implicitly
- (for example, integer arguments are stored in binary form,
- --- 122,134 ----
- Its main use is to find the location in which to store the converted value,
- located in argd\(->ad_valp.
- The string value to be converted is passed in
- ! .IR vp
- (which will be \s-1NULL\s+1 if the \s-1ARGNOVAL\s+1 flag was set for the
- corresponding entry in the arg-descriptor table).
- The
- .I copyf
- flag is TRUE if the
- ! .I vp
- string value must be copied when saved.
- Most non-string types are copied implicitly
- (for example, integer arguments are stored in binary form,
- ***************
- *** 137,143 ****
- Put simply, this flag is
- TRUE
- when
- ! .I argp
- points to a temporary buffer area.
- .PP
- If the type function successfully converts the value,
- --- 137,143 ----
- Put simply, this flag is
- TRUE
- when
- ! .I vp
- points to a temporary buffer area.
- .PP
- If the type function successfully converts the value,
- *** doc/parseargs1.inc.OLD Tue Mar 26 11:32:21 1991
- --- doc/parseargs1.inc Tue Mar 26 10:27:15 1991
- ***************
- *** 14,20 ****
- extra arguments,
- and argument values that are syntactically incorrect.
- Other behavior such as prompting the user for missing arguments and
- ! ignoring as command-line syntax may be specified on the command-line
- through the use of various options, or through the use of the
- ``\s-1PARSECNTL\s+1'' environment variable.
- .PP
- --- 14,20 ----
- extra arguments,
- and argument values that are syntactically incorrect.
- Other behavior such as prompting the user for missing arguments and
- ! ignoring bad command-line syntax may be specified on the command-line
- through the use of various options, or through the use of the
- ``\s-1PARSECNTL\s+1'' environment variable.
- .PP
- *** doc/sh_arrays.inc.OLD Tue Mar 26 11:32:52 1991
- --- doc/sh_arrays.inc Tue Mar 26 10:39:21 1991
- ***************
- *** 33,39 ****
- ``\fB*\fP'', then the positional parameters of the calling program
- will be re-assigned to the contents of the argument list.
- .PP
- ! For the \fIawk\fP and \fIperl\fP,
- if the variable name corresponding to the \s-1ARGLIST\s+1 argument is
- ``\fBARGV\fP'', then the positional parameters of the calling program
- will be re-assigned to the contents of the argument list.
- --- 33,39 ----
- ``\fB*\fP'', then the positional parameters of the calling program
- will be re-assigned to the contents of the argument list.
- .PP
- ! For \fIawk\fP and \fIperl\fP,
- if the variable name corresponding to the \s-1ARGLIST\s+1 argument is
- ``\fBARGV\fP'', then the positional parameters of the calling program
- will be re-assigned to the contents of the argument list.
- ***************
- *** 178,188 ****
- .nf
- .RS
- .ft 4
- ! @name=( arg1 , arg2 , ... )
- .ft R
- .RE
- .fi
- ! .SS ""A Final Note on Argument Lists"
- .PP
- The word-lists used by the C shell, the arrays used by the Korn shell, the
- Plan 9 shell, \fIawk\fP, \fIperl\fP, and the positional parameters used by
- --- 178,188 ----
- .nf
- .RS
- .ft 4
- ! @name=( arg1 , arg2 , ... );
- .ft R
- .RE
- .fi
- ! .SS "A Final Note on Argument Lists"
- .PP
- The word-lists used by the C shell, the arrays used by the Korn shell, the
- Plan 9 shell, \fIawk\fP, \fIperl\fP, and the positional parameters used by
- *** doc/shells.inc.OLD Tue Mar 26 11:32:55 1991
- --- doc/shells.inc Tue Mar 26 10:31:22 1991
- ***************
- *** 18,24 ****
- shell syntax to use. At present, \fBparseargs\fP only recognizes
- ``sh'', ``csh'', ``ksh'', ``tcsh'', ``bash'', ``rc'', ``awk'', and ``perl''
- as valid command interpreters. \fIAwk\fP output is slightly different from
- ! that of the other shells in that the actual variable setting are not
- printed but each line of an associative array is printed (the first field
- is the array index, the second is the value for that index).
- If no shell is specified, then the Bourne shell (``sh'') will be assumed.
- --- 18,24 ----
- shell syntax to use. At present, \fBparseargs\fP only recognizes
- ``sh'', ``csh'', ``ksh'', ``tcsh'', ``bash'', ``rc'', ``awk'', and ``perl''
- as valid command interpreters. \fIAwk\fP output is slightly different from
- ! that of the other shells in that the actual variable settings are not
- printed but each line of an associative array is printed (the first field
- is the array index, the second is the value for that index).
- If no shell is specified, then the Bourne shell (``sh'') will be assumed.
- *** parseargs.c.OLD Tue Mar 26 11:33:29 1991
- --- parseargs.c Tue Mar 26 10:38:26 1991
- ***************
- *** 13,19 ****
- ** arguments, converts values to the desired type, and diagnoses problems
- ** such as missing arguments, extra arguments, and argument values that
- ** are syntactically incorrect. Other behavior such as prompting the
- ! ** user for missing arguments and ignoring as command-line syntax may be
- ** specified on the command-line through the use of various options, or
- ** through the use of the "PARSECNTL" environment variable.
- **
- --- 13,19 ----
- ** arguments, converts values to the desired type, and diagnoses problems
- ** such as missing arguments, extra arguments, and argument values that
- ** are syntactically incorrect. Other behavior such as prompting the
- ! ** user for missing arguments and ignoring bad command-line syntax may be
- ** specified on the command-line through the use of various options, or
- ** through the use of the "PARSECNTL" environment variable.
- **
- ***************
- *** 158,164 ****
- ** to use. At present, parseargs only recognizes "sh", "csh", "ksh",
- ** "tcsh", "bash", "rc", "awk", and "perl" as valid command interpreters.
- ** Awk output is slightly different from that of the other shells in that
- ! ** the actual variable setting are not printed but each line of an
- ** associative array is printed (the first field is the array index, the
- ** second is the value for that index). If no shell is specified, then
- ** the Bourne shell ("sh") will be assumed.
- --- 158,164 ----
- ** to use. At present, parseargs only recognizes "sh", "csh", "ksh",
- ** "tcsh", "bash", "rc", "awk", and "perl" as valid command interpreters.
- ** Awk output is slightly different from that of the other shells in that
- ! ** the actual variable settings are not printed but each line of an
- ** associative array is printed (the first field is the array index, the
- ** second is the value for that index). If no shell is specified, then
- ** the Bourne shell ("sh") will be assumed.
- ***************
- *** 1578,1584 ****
- ** For perl, each argument list is considered an array and is set using
- ** the following syntax:
- **
- ! ** @name=( arg1 , arg2 , ... )
- **
- ** ^A_Final_Note_on_Argument_Lists:
- ** The word-lists used by the C shell, the arrays used by the Korn shell,
- --- 1578,1584 ----
- ** For perl, each argument list is considered an array and is set using
- ** the following syntax:
- **
- ! ** @name=( arg1 , arg2 , ... );
- **
- ** ^A_Final_Note_on_Argument_Lists:
- ** The word-lists used by the C shell, the arrays used by the Korn shell,
- *** parseargs.h.OLD Tue Mar 26 11:33:56 1991
- --- parseargs.h Tue Mar 26 11:10:05 1991
- ***************
- *** 70,76 ****
- */
- BOOL (*ad_type) ARGS((struct _argdesc *, char *, BOOL));
- /* -- This field is a pointer to a type conversion function (such as the
- ! ** ones provided in argtype(3). The type conversion function is respon-
- ** sible for verifying the validity of the argument, allocating any
- ** necessary storage for its internal representation, and converting
- ** the command-line argument into its required internal form. The type
- --- 70,76 ----
- */
- BOOL (*ad_type) ARGS((struct _argdesc *, char *, BOOL));
- /* -- This field is a pointer to a type conversion function (such as the
- ! ** ones provided in argtype(3)). The type conversion function is respon-
- ** sible for verifying the validity of the argument, allocating any
- ** necessary storage for its internal representation, and converting
- ** the command-line argument into its required internal form. The type
- ***************
- *** 89,108 ****
- ** pointer to a number, a boolean value, a string, a list, or anything
- ** else for which there exists a corresponding arg-type function to
- ** use in the ad_type field. In the case of of parseargs(1) this field
- ! ** must be the name of the corresponding shell variable which eventually
- ! ** hold the value of the argument given on the command-line.
- */
- CONST char *ad_prompt;
- /* -- This field contains the long-name of the argument and an optional
- ** description (the description must be separated from the long-name by
- ! ** at least one whitespace characters and may optionally be enclosed in
- ** a set of balanced delimiters (such as parentheses, curly-braces,
- ! ** square-brackets, or angle-brackets. If the long-name contains any
- ** uppercase characters, then the substring of long-name consisting of
- ! ** all uppercase characters is used as the argument name and the entire
- ! ** long-name is used as the name of the argument-value (if a value my be
- ! ** supplied). The long-name may be matched by supplying a unique prefix
- ! ** of either the argument name or the argument-value name.
- */
- } ARGDESC;
- /**^^**********************************************************************/
- --- 89,108 ----
- ** pointer to a number, a boolean value, a string, a list, or anything
- ** else for which there exists a corresponding arg-type function to
- ** use in the ad_type field. In the case of of parseargs(1) this field
- ! ** must be the name of the corresponding shell variable which will
- ! ** eventually hold the value of the argument given on the command-line.
- */
- CONST char *ad_prompt;
- /* -- This field contains the long-name of the argument and an optional
- ** description (the description must be separated from the long-name by
- ! ** at least one whitespace character and may optionally be enclosed in
- ** a set of balanced delimiters (such as parentheses, curly-braces,
- ! ** square-brackets, or angle-brackets). If the long-name contains any
- ** uppercase characters, then the substring of long-name consisting of
- ! ** all uppercase characters is used as the argument keyword and the
- ! ** entire long-name is used as the name of the argument (if a value may
- ! ** be supplied). The long-name may be matched by supplying a unique
- ! ** prefix of either the argument keyword or the argument name.
- */
- } ARGDESC;
- /**^^**********************************************************************/
- ***************
- *** 419,433 ****
- ** ARGLISTNULL is simply the NULL argument-list pointer. L_NEXT and
- ** L_STRING each take a pointer to a non-NULL ArgList structure. L_NEXT
- ** returns the address of the next item in the list and L_STRING returns
- ! ** the string-value of the current list-item. L_FLAGS return the arg-
- ! ** flags for a given item in the list. With non-multivalued, only the
- ** flags in the argument descriptor are needed; lists and vectors however
- ** need a set of flags for each item they contain. Once an arg-list has
- ** been created, it may be deallocated using the function listFree. List-
- ! ** Free takes two parameters, the first of which is the address of the
- ! ** first item in the arg-list, and the second of which is a boolean value
- ! ** that is TRUE only if each value pointed to by each item should also be
- ! ** deallocated.
- **
- ** An alternative to argument-lists is argument vectors (or arg-vectors).
- ** Arg-vectors use the ARGVEC flag instead of the ARGLIST flag and do not
- --- 419,430 ----
- ** ARGLISTNULL is simply the NULL argument-list pointer. L_NEXT and
- ** L_STRING each take a pointer to a non-NULL ArgList structure. L_NEXT
- ** returns the address of the next item in the list and L_STRING returns
- ! ** the string-value of the current list-item. L_FLAGS return the argflags
- ! ** for a given item in the list. With non-multivalued arguments, only the
- ** flags in the argument descriptor are needed; lists and vectors however
- ** need a set of flags for each item they contain. Once an arg-list has
- ** been created, it may be deallocated using the function listFree. List-
- ! ** Free takes one parameter: the address of the first item in the arg-list.
- **
- ** An alternative to argument-lists is argument vectors (or arg-vectors).
- ** Arg-vectors use the ARGVEC flag instead of the ARGLIST flag and do not
- *** test.rc.OLD Tue Mar 26 11:35:44 1991
- --- test.rc Mon Mar 25 09:47:08 1991
- ***************
- *** 21,34 ****
- yflag='TRUE' ## set defaults (dir="."; count=1; sepch=',') ##
-
- ## parse command-line and save assignments in a temporary file ##
- ! parseargs -s rc -e ARGUMENTS -u -- $^NAME "$@" >/tmp/tmp$$
- if ( $status != 0 ) {
- ! rm -f /tmp/tmp$$;
- exit 2 ## non-zero status (usage given)
- }
-
- ## evaluate results from parseargs and remove temporary file
- ! . /tmp/tmp$$; rm -f /tmp/tmp$$
-
- ## echo the parsed arguments (use defaults if not defined)
- echo 'ARGUMENTS:'
- --- 21,34 ----
- yflag='TRUE' ## set defaults (dir="."; count=1; sepch=',') ##
-
- ## parse command-line and save assignments in a temporary file ##
- ! parseargs -s rc -e ARGUMENTS -u -- $^NAME $@ >/tmp/tmp$pid
- if ( $status != 0 ) {
- ! rm -f /tmp/tmp$pid;
- exit 2 ## non-zero status (usage given)
- }
-
- ## evaluate results from parseargs and remove temporary file
- ! . /tmp/tmp$pid; rm -f /tmp/tmp$pid
-
- ## echo the parsed arguments (use defaults if not defined)
- echo 'ARGUMENTS:'
- *** xparse.c.OLD Tue Mar 26 11:36:41 1991
- --- xparse.c Tue Mar 26 11:12:58 1991
- ***************
- *** 63,69 ****
- ** When a non-multivalued argument appears more than once on the
- ** command-line then only the last value supplied is used. A problem
- ** occurs however in the following scenario: suppose `-s' is an option
- ! ** that takes an optional string argument (nd suppose `-x' is some
- ** boolean flag). Then if the following command-line is issued:
- **
- ** command -s string -x -s
- --- 63,69 ----
- ** When a non-multivalued argument appears more than once on the
- ** command-line then only the last value supplied is used. A problem
- ** occurs however in the following scenario: suppose `-s' is an option
- ! ** that takes an optional string argument (and suppose `-x' is some
- ** boolean flag). Then if the following command-line is issued:
- **
- ** command -s string -x -s
- ***************
- *** 1143,1149 ****
- ** command-line arguments and continue execution of
- ** the program. Normally, if an argument is unmatched
- ** (or is improperly specified), a usage message is
- ! ** printed program execution is terminated.
- **
- ** "OptsOnly" Under UNIX, setting this flag will disable the
- ** parsing of long-option syntax. This will cause all
- --- 1143,1149 ----
- ** command-line arguments and continue execution of
- ** the program. Normally, if an argument is unmatched
- ** (or is improperly specified), a usage message is
- ! ** printed and program execution is terminated.
- **
- ** "OptsOnly" Under UNIX, setting this flag will disable the
- ** parsing of long-option syntax. This will cause all
- ***************
- *** 1171,1182 ****
- ** examples are considered to consist of one option
- ** and one positional argument.
- **
- ! ** "CaseIgnore" Setting this flag cause character-case to be
- ** ignored when attempting to match single-character
- ** argument names (i.e. causes "-i" and "-I" will be
- ** considered equivalent).
- **
- ! ** If the environment variable "PARSECNTL" is empty or undefined, then
- ** parsing behavior set by the programmer is used. If the programmer has
- ** not explicitly used parsecntl(3) to modify the parsing behavior, then
- ** the default behavior will be "Flags1st" for Unix Systems,
- --- 1171,1182 ----
- ** examples are considered to consist of one option
- ** and one positional argument.
- **
- ! ** "CaseIgnore" Setting this flag causes character-case to be
- ** ignored when attempting to match single-character
- ** argument names (i.e. causes "-i" and "-I" will be
- ** considered equivalent).
- **
- ! ** If the environment variable "PARSECNTL" is empty or undefined, then the
- ** parsing behavior set by the programmer is used. If the programmer has
- ** not explicitly used parsecntl(3) to modify the parsing behavior, then
- ** the default behavior will be "Flags1st" for Unix Systems,
- ***************
- *** 1997,2003 ****
-
- /* ^DESCRIPTION:
- ** Given an ArgList and an argdesc array, lparseargs will parse arguments
- ! ** in a file in much the same manner as parseargs.
- **
- ** ^REQUIREMENTS:
- ** <argls> should be an ArgList of strings
- --- 1997,2003 ----
-
- /* ^DESCRIPTION:
- ** Given an ArgList and an argdesc array, lparseargs will parse arguments
- ! ** in an ArgList in much the same manner as parseargs.
- **
- ** ^REQUIREMENTS:
- ** <argls> should be an ArgList of strings
-