home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume18 / parseargs / patch04a / DOCPATCH < prev   
Text File  |  1991-04-25  |  49KB  |  1,651 lines

  1. *** /hx1d3/lp/brad/parseargs_patch03/parseargs/argtype3.txt    Wed Apr 10 09:55:51 1991
  2. --- argtype3.txt    Mon Apr 15 08:31:00 1991
  3. ***************
  4. *** 42,51 ****
  5.        called when an argument of    that particular    type is    matched
  6.        by    one of the argument parsing function in    parseargs(3).
  7.        When such an argument is matched, its argument translation
  8. !      routines is invoked and is    passed (1) the address of the
  9.        argument descriptor for the matched argument, (2) the possi-
  10.        ble argument string for that matched argument, and    (3) a
  11. !      boolean filed that    is TRUE    only if    the second parameter
  12.        points to temporary storage (indicating that some copying
  13.        may need to be done instead of just pointing to the same
  14.        object).
  15. --- 42,51 ----
  16.        called when an argument of    that particular    type is    matched
  17.        by    one of the argument parsing function in    parseargs(3).
  18.        When such an argument is matched, its argument translation
  19. !      routine is    invoked    and is passed (1) the address of the
  20.        argument descriptor for the matched argument, (2) the possi-
  21.        ble argument string for that matched argument, and    (3) a
  22. !      boolean field that    is TRUE    only if    the second parameter
  23.        points to temporary storage (indicating that some copying
  24.        may need to be done instead of just pointing to the same
  25.        object).
  26. ***************
  27. *** 229,235 ****
  28.        followed by the type of the items in the vector.
  29.   
  30.   SEE ALSO
  31. !      parseargs(3), parseargs(3), parsecntl(1),
  32.   
  33.   
  34.   
  35. --- 229,235 ----
  36.        followed by the type of the items in the vector.
  37.   
  38.   SEE ALSO
  39. !      parseargs(3), parseargs(1), parsecntl(3)
  40.   
  41.   
  42.   
  43. *** /hx1d3/lp/brad/parseargs_patch03/parseargs/parseargs1.txt    Wed Apr 10 09:55:52 1991
  44. --- parseargs1.txt    Mon Apr 15 08:31:18 1991
  45. ***************
  46. *** 9,19 ****
  47.        parseargs - parse command line arguments in shell scripts
  48.   
  49.   SYNOPSIS
  50. !      parseargs     [-U] [-M] [-T string] [-F string] [-A]    [-a arg-
  51. !          spec] [-e name] [-f file] [-l]    [-o] [-s shell]
  52. !          [-u] [-i] [-p]    -- name    [arguments ...]
  53.   
  54.   OPTIONS
  55.        -U           just    print program usage, do    not parse the
  56.              command line
  57.   
  58. --- 9,22 ----
  59.        parseargs - parse command line arguments in shell scripts
  60.   
  61.   SYNOPSIS
  62. !      parseargs     [-#UMCAlouip1]    [-S separator] [-T string]
  63. !          [-F string] [-a arg-spec] [-e name] [-f file]
  64. !          [-s shell] -- name [arguments ...]
  65.   
  66.   OPTIONS
  67. +      -#           just    print the version and patchlevel, do not
  68. +            parse the command line
  69.        -U           just    print program usage, do    not parse the
  70.              command line
  71.   
  72. ***************
  73. *** 20,25 ****
  74. --- 23,31 ----
  75.        -M           just    print (n|t)roff    -man manual page
  76.              template, do    not parse the command line
  77.   
  78. +      -S    separator  field-separator-string used to delimit array
  79. +            elements  (default=
  80.        -T    string       string to use for true boolean arguments
  81.              (default=``TRUE'')
  82.   
  83. ***************
  84. *** 26,31 ****
  85. --- 32,40 ----
  86.        -F    string       string to use for false boolean arguments
  87.              (default=``'')
  88.   
  89. +      -C           Ignore the difference between upper and lower
  90. +            case    when parsing single character options.
  91.        -A           modify array    behavior for the specified shell.
  92.   
  93.        -a    arg-spec   argument specification string
  94. ***************
  95. *** 48,76 ****
  96.   
  97.        -p           prompt the user for missing required    arguments
  98.   
  99. -      -i           ignore bad command-line syntax and continue
  100. -            processing (instead of aborting)
  101.   
  102. - ARGUMENTS
  103. -      --           Indicates that any remaining    options    are
  104. -            intended for    the calling program.
  105.   
  106. -      name       name    of calling program
  107.   
  108.   
  109.   
  110.   
  111. - Page 1
  112.   
  113.   
  114.   
  115.   
  116.   
  117.   
  118. ! PARSEARGS(1)                         PARSEARGS(1)
  119.   
  120.   
  121.   
  122.        arguments       arguments to    calling    program
  123.   
  124.   DESCRIPTION
  125. --- 57,89 ----
  126.   
  127.        -p           prompt the user for missing required    arguments
  128.   
  129.   
  130.   
  131.   
  132. + Page 1
  133.   
  134.   
  135.   
  136.   
  137.   
  138.   
  139. + PARSEARGS(1)                         PARSEARGS(1)
  140.   
  141.   
  142.   
  143. !      -i           ignore bad command-line syntax and continue
  144. !            processing (instead of aborting)
  145.   
  146. +      -1           Force any and all non-positional parameters to
  147. +            be specified    before any positional parameters
  148. +            on the command-line.
  149.   
  150. + ARGUMENTS
  151. +      --           Indicates that any remaining    options    are
  152. +            intended for    the calling program.
  153.   
  154. +      name       name    of calling program
  155.        arguments       arguments to    calling    program
  156.   
  157.   DESCRIPTION
  158. ***************
  159. *** 98,131 ****
  160.        on    standard output    that is    suitable for input to nroff or
  161.        troff using the -man macro    package.
  162.   
  163.        The argument specification    string contains    one entry for
  164. !      each possible flag.  Entries in the arguments specification
  165.        string are    separated by commas.  Each entry has five comma-
  166.        separated fields:    a name,    some flags, a type, a variable-
  167.        name, and a prompt.  Each of these    fields are described
  168.        below:
  169.   
  170. -      name      The single character name of the    associated flag.
  171. -            For example, to indicate    that the program is
  172. -            expecting a ``-x'' flag,    this field would contain
  173. -            'x'.  Positional    arguments (those without a ``-x''
  174. -            prefix) are indicated by    passing    a ``space''
  175. -            character.
  176.   
  177. -      flags     Flags modifying the semantics of    this entry.
  178. -            These should have one of    ARGREQ to indicate a
  179. -            required    argument or ARGOPT to indicate an
  180. -            optional    argument (ARGOPT is the    default    unless
  181. -            ARGREQ is specified).  ARGPOS can be ``ored'' in
  182. -            to indicate a positional    argument that may also be
  183. -            keyword matched.     ARGNOVAL can be ``ored'' in to
  184. -            indicate    that an    argument is an option or a
  185. -            keyword that does not use an accompanying argument
  186. -            (such as    a boolean flag). This flag is only
  187. -            required    for corresponding argument types that are
  188.   
  189.   
  190.   Page 2
  191.   
  192.   
  193. --- 111,131 ----
  194.        on    standard output    that is    suitable for input to nroff or
  195.        troff using the -man macro    package.
  196.   
  197. +      Given no other arguments parseargs    -# prints on standard
  198. +      output, the current version and patchlevel    of the running
  199. +      version of    parseargs.
  200.        The argument specification    string contains    one entry for
  201. !      each possible flag.  Entries in the argument specification
  202.        string are    separated by commas.  Each entry has five comma-
  203.        separated fields:    a name,    some flags, a type, a variable-
  204.        name, and a prompt.  Each of these    fields are described
  205.        below:
  206.   
  207.   
  208.   
  209.   
  210.   Page 2
  211.   
  212.   
  213. ***************
  214. *** 137,154 ****
  215.   
  216.   
  217.   
  218. !            implemented by the programmer; parseargs    already
  219. !            knows which pre-defined argument    types take an
  220. !            argument.  ARGVALOPT can    be ``ored'' in to
  221.              indicate    that an    argument to the    option may be
  222.              optionally supplied on the command-line,    but is
  223. !            not required.  ARGVALREQ    can be ``ored''    in to
  224.              indicate    that an    argument to the    option is
  225.              required    (this is the default behavior for options
  226. !            that take arguments).  ARGLIST can be ``ored'' in
  227.              (using the `|' character) to indicate that an
  228.              argument    is actually a list of one or more
  229. !            arguments from the command line.     ARGHIDDEN can be
  230.              ``ored''    in to indicate a flag that should not be
  231.              printed in usage    messages - for example,    flags
  232.              intended    for internal debugging purposes.
  233. --- 137,165 ----
  234.   
  235.   
  236.   
  237. !      name      The single character name of the    associated flag.
  238. !            For example, to indicate    that the program is
  239. !            expecting a ``-x'' flag,    this field would contain
  240. !            'x'.  Positional    arguments (those without a ``-x''
  241. !            prefix) are indicated by    passing    a ``space''
  242. !            character.
  243. !      flags     Flags modifying the semantics of    this entry.
  244. !            These should have one of    ARGREQ to indicate a
  245. !            required    argument or ARGOPT to indicate an
  246. !            optional    argument (ARGOPT is the    default    unless
  247. !            ARGREQ is specified).  ARGPOS may be ``ored'' in
  248. !            to indicate a positional    argument that may also be
  249. !            keyword matched.     ARGVALOPT may be ``ored'' in to
  250.              indicate    that an    argument to the    option may be
  251.              optionally supplied on the command-line,    but is
  252. !            not required.  ARGVALREQ    may be ``ored''    in to
  253.              indicate    that an    argument to the    option is
  254.              required    (this is the default behavior for options
  255. !            that take arguments).  ARGLIST may be ``ored'' in
  256.              (using the `|' character) to indicate that an
  257.              argument    is actually a list of one or more
  258. !            arguments from the command line.     ARGHIDDEN may be
  259.              ``ored''    in to indicate a flag that should not be
  260.              printed in usage    messages - for example,    flags
  261.              intended    for internal debugging purposes.
  262. ***************
  263. *** 177,194 ****
  264.        The argument specification    string must be terminated by the
  265.        single string:  ``ENDOFARGS''.
  266.   
  267. -      Note that the comma character (',') is used to separate all
  268. -      fields within an entry, and to separate the entries
  269. -      themselves.  For this reason, no field in any entry may
  270. -      contain a comma unless it appears inside of double    or single
  271. -      quotes.
  272.   
  273. -      Parseargs will parse all command-line arguments for the
  274. -      calling script and    match them against the argument
  275. -      specification string provided. The    argument specification
  276. -      string is read from standard input    by default but may not
  277. -      come from a terminal. The argument    specification string may
  278. -      be    supplied as a single string argument by    using the -a
  279.   
  280.   
  281.   
  282. --- 188,194 ----
  283. ***************
  284. *** 203,208 ****
  285. --- 203,220 ----
  286.   
  287.   
  288.   
  289. +      Note that the comma character (',') is used to separate all
  290. +      fields within an entry, and to separate the entries
  291. +      themselves.  For this reason, no field in any entry may
  292. +      contain a comma unless it appears inside of double    or single
  293. +      quotes.
  294. +      Parseargs will parse all command-line arguments for the
  295. +      calling script and    match them against the argument
  296. +      specification string provided. The    argument specification
  297. +      string is read from standard input    by default but may not
  298. +      come from a terminal. The argument    specification string may
  299. +      be    supplied as a single string argument by    using the -a
  300.        ``string''    flag.  Long argument specification strings
  301.        however, may limit    the number of arguments    to the script if
  302.        there is a    limit to the number of arguments and/or
  303. ***************
  304. *** 244,263 ****
  305.        string option.  The same may also be done for a boolean flag
  306.        that is false using the -F    string option.
  307.   
  308. -      Parseargs will only set the values    of variables that
  309. -      correspond    to arguments that were given on    the command line.
  310. -      If    a particular argument was not supplied on the command
  311. -      line, then    no assignment is made for the corresponding shell
  312. -      variable and it will have the same    value that it had before
  313. -      parseargs was invoked. The    only exception to this is that if
  314. -      the -u option is specified, then the positional parameters
  315. -      are unset before any shell    variable assignments (which may
  316. -      reset the positional parameters) are made.
  317.   
  318.   
  319.   Page 4
  320.   
  321.   
  322. --- 256,263 ----
  323. ***************
  324. *** 269,274 ****
  325. --- 269,284 ----
  326.   
  327.   
  328.   
  329. +      Parseargs will only set the values    of variables that
  330. +      correspond    to arguments that were given on    the command line.
  331. +      If    a particular argument was not supplied on the command
  332. +      line, then    no assignment is made for the corresponding shell
  333. +      variable and it will have the same    value that it had before
  334. +      parseargs was invoked. The    only exception to this is that if
  335. +      the -u option is specified, then the positional parameters
  336. +      are unset before any shell    variable assignments (which may
  337. +      reset the positional parameters) are made.
  338.        The double-dash (``--'') which precedes the name and
  339.        arguments of the calling program is needed    in order for
  340.        parseargs to be able to distinguish options to itself from
  341. ***************
  342. *** 280,285 ****
  343. --- 290,310 ----
  344.        options) are to be    permitted by specifying    the -o (-l)
  345.        option on the command-line.
  346.   
  347. + SPECIFYING PARSE-BEHAVIOR
  348. +      The -C, -p, -i, and -1 switches may be used to modify the
  349. +      command-line parsing behavior of the invoking script.
  350. +      Specifying    -C will    cause case-differences in single-
  351. +      character options to be ignored. Specifying -p will cause
  352. +      the user to be interactively prompted for any missing
  353. +      required arguments. Specifying -i will cause syntactically
  354. +      incorrect arguments to be ignored (instead    of having a usage
  355. +      message printed and execution terminated).    Specifying -1
  356. +      will force    all non-positional parameters to precede any
  357. +      positional    parameters on the command-line (hence anything on
  358. +      the command-line after a positional parameter that    resembles
  359. +      a keyword parameter will nevertheles be interpreted as a
  360. +      positional    parameter).
  361.   OPTIONS    WITH OPTIONAL ARGUMENTS
  362.        Options that may take an optional argument    need special
  363.        consideration.  The shell programmer needs    to know    whether
  364. ***************
  365. *** 297,302 ****
  366. --- 322,340 ----
  367.        the shell variable    associated with    the option in the
  368.        argument description string.
  369.   
  370. + Page 5
  371. + PARSEARGS(1)                         PARSEARGS(1)
  372.   ARGUMENT LISTS
  373.        Parseargs treats ARGLIST arguments    in a special way. The
  374.        method used for setting up    an argument list depends largely
  375. ***************
  376. *** 321,340 ****
  377.        positional    parameters of the calling program will be re-
  378.        assigned to the contents of the argument list.
  379.   
  380. - Page 5
  381. - PARSEARGS(1)                         PARSEARGS(1)
  382.        For the Plan 9 shell (rc),    if the variable    name
  383.        corresponding to the ARGLIST argument is ``*'', then the
  384.        positional    parameters of the calling program will be re-
  385. --- 359,364 ----
  386. ***************
  387. *** 344,349 ****
  388. --- 368,374 ----
  389.        ARGLIST argument is ``ARGV'', then    the positional parameters
  390.        of    the calling program will be re-assigned    to the contents
  391.        of    the argument list.
  392.        Bourne Shell Argument Lists
  393.   
  394.        For the Bourne shell, if the associated variable name is NOT
  395. ***************
  396. *** 356,362 ****
  397.        contains an IFS character (such as    a space    or a tab), then
  398.        that particular word will be treated by the Bourne    shell as
  399.        two distinct words.
  400.        Also for the Bourne shell,    If the associated variable name
  401.        is    NOT ``--'' and the -A option WAS specified, then that
  402.        variable is treated as the    root name of an    array that is set
  403. --- 381,386 ----
  404. ***************
  405. *** 363,368 ****
  406. --- 387,406 ----
  407.        using the following syntax:
  408.         name1='arg1'
  409.         name2='arg2'
  410. + Page 6
  411. + PARSEARGS(1)                         PARSEARGS(1)
  412.             ...
  413.        and the variable ``name_count'' will be set to contain the
  414.        number of items in    the array.  The    user may then step
  415. ***************
  416. *** 387,406 ****
  417.        overwritten by the    set command).
  418.        It    should be noted    that there is a    bug in versions    of the
  419.        Korn shell    earlier    than 11/16/88a,    in which the following:
  420. - Page 6
  421. - PARSEARGS(1)                         PARSEARGS(1)
  422.         set  -A  name     'arg1'     'arg2'     ...
  423.        causes the    positional parameters to be overwritten    as an
  424.        unintentional side-effect.    If your    version    of the Korn shell
  425. --- 425,430 ----
  426. ***************
  427. *** 409,414 ****
  428. --- 433,439 ----
  429.        must save them yourself before you    call parseargs.    This may
  430.        be    accomplished by    the following:
  431.         set  -A  save_parms  "$@"
  432.        C and TC Shell Argument Lists
  433.   
  434.        For the C and TC shells, ARGLIST variables    are treated as
  435. ***************
  436. *** 418,436 ****
  437.        in    $name[2], etc ..., and all items may be    given by $name.
  438.        Notice that Korn shell arrays start at index zero whereas C
  439.        and TC shell word-lists start at index one.
  440.        Bourne-Again Shell    Argument Lists
  441.   
  442.        At    present, the Free Software Foundation's    Bourne-Again
  443.        shell is treated exactly the same as the Bourne Shell. This
  444.        will change when bash supports arrays.
  445.        Plan 9 Shell Argument Lists
  446.   
  447.        For the Plan 9 shell, if the associated variable name is not
  448. !      ``*'' then    it is considered to be word-list and set using
  449.        the following syntax:
  450.         name=( 'arg1'     'arg2'     ... )
  451.        Awk Argument Lists
  452.        For awk, if the -A    option is not given, then the output for
  453.        thes variable-list    will be    a line with the    variable name,
  454. --- 443,474 ----
  455.        in    $name[2], etc ..., and all items may be    given by $name.
  456.        Notice that Korn shell arrays start at index zero whereas C
  457.        and TC shell word-lists start at index one.
  458.        Bourne-Again Shell    Argument Lists
  459.   
  460.        At    present, the Free Software Foundation's    Bourne-Again
  461.        shell is treated exactly the same as the Bourne Shell. This
  462.        will change when bash supports arrays.
  463.        Plan 9 Shell Argument Lists
  464.   
  465.        For the Plan 9 shell, if the associated variable name is not
  466. !      ``*'' then    it is considered to be a word-list and set using
  467. ! Page 7
  468. ! PARSEARGS(1)                         PARSEARGS(1)
  469.        the following syntax:
  470.         name=( 'arg1'     'arg2'     ... )
  471.        Awk Argument Lists
  472.        For awk, if the -A    option is not given, then the output for
  473.        thes variable-list    will be    a line with the    variable name,
  474. ***************
  475. *** 442,448 ****
  476.        If    the -A option is given,    then the associated variable is
  477.        considered    the root name of an array. The ouput for the
  478.        array will    consist    of two lines for each item in the list
  479. !      (as in the    following expample):
  480.         name1
  481.         arg1
  482.   
  483. --- 480,486 ----
  484.        If    the -A option is given,    then the associated variable is
  485.        considered    the root name of an array. The ouput for the
  486.        array will    consist    of two lines for each item in the list
  487. !      (as in the    following example):
  488.         name1
  489.         arg1
  490.   
  491. ***************
  492. *** 452,477 ****
  493.        and the variable ``name_count'' will have an output line
  494.        showing the number    of items in the    array.
  495.   
  496. - Page 7
  497. - PARSEARGS(1)                         PARSEARGS(1)
  498.        Perl Argument Lists
  499.   
  500.        For perl, each argument list is considered    an array and is
  501.        set using the following syntax:
  502. !       @name=( arg1 , arg2 ,     ... );
  503.        A Final Note on Argument Lists
  504.   
  505.        The word-lists used by the    C shell, the arrays used by the
  506. --- 490,501 ----
  507.        and the variable ``name_count'' will have an output line
  508.        showing the number    of items in the    array.
  509.   
  510.        Perl Argument Lists
  511.   
  512.        For perl, each argument list is considered    an array and is
  513.        set using the following syntax:
  514. !       @name=( 'arg1' , 'arg2' ,  ... );
  515.        A Final Note on Argument Lists
  516.   
  517.        The word-lists used by the    C shell, the arrays used by the
  518. ***************
  519. *** 495,500 ****
  520. --- 519,538 ----
  521.        ARGLISTs and ARGVECs set in ``CMD_ARGS'' will be appended
  522.        from the command-line if they are selected).
  523.   
  524. + Page 8
  525. + PARSEARGS(1)                         PARSEARGS(1)
  526.        It    is important to    note that the contents of the
  527.        ``CMD_ARGS'' environment variable are NOT expanded    by the
  528.        shell and hence any special characters (such as quotes or
  529. ***************
  530. *** 519,538 ****
  531.        of    parsecntl(3).  The user    may set    his (or    her) own desired
  532.        parsing behavior through the use of the ``PARSECNTL''
  533.        environment variable.  By indicating any number of    flags
  534. - Page 8
  535. - PARSEARGS(1)                         PARSEARGS(1)
  536.        (possibly negated)    the user will directly modify the
  537.        behavior of the parseargs library.    Flags may be combined by
  538.        placing a `+' or `|' character in between flags. A    switch is
  539. --- 557,562 ----
  540. ***************
  541. *** 551,570 ****
  542.        Ignore
  543.         Ignore any unrecognized or improperly    specified
  544.         command-line arguments and continue execution    of the
  545. !       program. Normally, if    an argument is unmatched (or is
  546. !       improperly specified), a usage message is printed and
  547. !       program execution is terminated.
  548.   
  549.        OptsOnly
  550.         Under    UNIX, setting this flag    will disable the parsing
  551.         of long-option syntax. This will cause all arguments
  552. !       starting with    '+' to always be treated as a positional
  553.         parameter (instead of    a long-option).
  554.   
  555.        KwdsOnly
  556.         Under    UNIX, setting this flag    disables the parsing of
  557.         single-character options.  This will cause all
  558. !       arguments starting with '-' to always    be treated as a
  559.         positional parameter (instead    of an option).
  560.   
  561.        LoptsOnly
  562. --- 575,608 ----
  563.        Ignore
  564.         Ignore any unrecognized or improperly    specified
  565.         command-line arguments and continue execution    of the
  566. !       program. Normally, if    a required argument is unmatched
  567. !       (or an argument is improperly    specified), a usage
  568. !       message is printed program execution is terminated.
  569.   
  570.        OptsOnly
  571.         Under    UNIX, setting this flag    will disable the parsing
  572.         of long-option syntax. This will cause all arguments
  573. !       starting with    `+' to always be treated as a positional
  574.         parameter (instead of    a long-option).
  575.   
  576. + Page 9
  577. + PARSEARGS(1)                         PARSEARGS(1)
  578.        KwdsOnly
  579.         Under    UNIX, setting this flag    disables the parsing of
  580.         single-character options.  This will cause all
  581. !       arguments starting with `-' to always    be treated as a
  582.         positional parameter (instead    of an option).
  583.   
  584.        LoptsOnly
  585. ***************
  586. *** 585,609 ****
  587.         one positional argument.
  588.   
  589.        CaseIgnore
  590.   
  591. - Page 9
  592. - PARSEARGS(1)                         PARSEARGS(1)
  593. -       Setting this flag causes character-case to be    ignored
  594. -       when attempting to match single-character argument
  595. -       names    (i.e. causes "-i" and "-I" will    be considered
  596. -       equivalent).
  597.        If    the environment    variable ``PARSECNTL'' is empty    or
  598.        undefined,    then the parsing behavior set by the programmer
  599.        is    used.  If the programmer has not explicitly used
  600. --- 623,633 ----
  601.         one positional argument.
  602.   
  603.        CaseIgnore
  604. +       Setting this flag will cause character-case to be
  605. +       ignored when attempting to match single-character
  606. +       argument names (i.e. causes "-i" and "-I" to be
  607. +       considered equivalent).
  608.   
  609.        If    the environment    variable ``PARSECNTL'' is empty    or
  610.        undefined,    then the parsing behavior set by the programmer
  611.        is    used.  If the programmer has not explicitly used
  612. ***************
  613. *** 627,638 ****
  614.        only a command-line synopsis is printed (this is also
  615.        refferred to as ``terse'' mode). The other    two ``modes''
  616.        control the displaying of option syntax and long-option
  617. -      syntax. A mode may    be explicitly disabled by preceding its
  618. -      corresponding string with the `!'    character. The ``modes''
  619. -      which correspond to the possible values of    the ``USAGECNTL''
  620. -      environment variable are given by the following table.
  621.   
  622.   
  623.        Quiet
  624.         No usage message of any kind is displayed.
  625.   
  626. --- 651,676 ----
  627.        only a command-line synopsis is printed (this is also
  628.        refferred to as ``terse'' mode). The other    two ``modes''
  629.        control the displaying of option syntax and long-option
  630.   
  631.   
  632. + Page 10
  633. + PARSEARGS(1)                         PARSEARGS(1)
  634. +      syntax. A mode may    be explicitly disabled by preceding its
  635. +      corresponding string with the `!'    or `-' character. The
  636. +      ``modes'' which correspond    to the possible    values of the
  637. +      ``USAGECNTL'' environment variable    are given by the
  638. +      following table.
  639.        Quiet
  640.         No usage message of any kind is displayed.
  641.   
  642. ***************
  643. *** 651,670 ****
  644.        Description
  645.         The command description is printed.
  646.   
  647. - Page 10
  648. - PARSEARGS(1)                         PARSEARGS(1)
  649.        Terse
  650.         Terse    mode, just print command-line synopsis.
  651.   
  652. --- 689,694 ----
  653. ***************
  654. *** 680,685 ****
  655. --- 704,710 ----
  656.        KeyWords
  657.         Same as LongOpts.
  658.   
  659.        If    the environment    variable ``USAGECNTL'' is empty    or
  660.        undefined,    then the default usage level (which is presently
  661.        ``Verbose + Options'') will be used.
  662. ***************
  663. *** 689,697 ****
  664.        specification for a Bourne    shell script:
  665.   
  666.        #!/bin/sh
  667.        RepCount=2;
  668.        Verbose="";
  669.        ARGSPEC="
  670.        'c', ARGOPT,          argInt,  RepCount, 'count    {# times to repeat}',
  671.        'v', ARGOPT,          argBool, Verbose,     'verbose {turn    on verbose mode}',
  672. --- 714,736 ----
  673.        specification for a Bourne    shell script:
  674.   
  675.        #!/bin/sh
  676.        RepCount=2;
  677.        Verbose="";
  678. + Page 11
  679. + PARSEARGS(1)                         PARSEARGS(1)
  680.        ARGSPEC="
  681.        'c', ARGOPT,          argInt,  RepCount, 'count    {# times to repeat}',
  682.        'v', ARGOPT,          argBool, Verbose,     'verbose {turn    on verbose mode}',
  683. ***************
  684. *** 701,708 ****
  685.        ' ', ARGOPT|ARGLIST, listStr, Files,     'files    {files to process}',
  686.        ENDOFARGS
  687.        "
  688.   
  689. -      eval `echo    "$ARGUMENTS" | parseargs -s sh -- $0 "$@"`
  690.   
  691.        This describes a Bourne shell script accepting up to three
  692.        flag arguments and    one or two positional arguments, plus a
  693. --- 740,747 ----
  694.        ' ', ARGOPT|ARGLIST, listStr, Files,     'files    {files to process}',
  695.        ENDOFARGS
  696.        "
  697. +      eval `echo    "$ARGSPEC" | parseargs -s sh --    $0 "$@"`
  698.   
  699.   
  700.        This describes a Bourne shell script accepting up to three
  701.        flag arguments and    one or two positional arguments, plus a
  702. ***************
  703. *** 717,736 ****
  704.               FALSE (an empty string).
  705.   
  706.         -X        A Boolean ``X Rated'' flag.     This is not
  707. - Page 11
  708. - PARSEARGS(1)                         PARSEARGS(1)
  709.               printed in the usage message.
  710.   
  711.        The two positional    arguments are both strings, as is the
  712. --- 756,761 ----
  713. ***************
  714. *** 758,763 ****
  715. --- 783,802 ----
  716.        associated    command    line variables,    and then prints    its
  717.        command usage.
  718.   
  719. + Page 12
  720. + PARSEARGS(1)                         PARSEARGS(1)
  721.        #!/bin/sh
  722.        #      test.sh - Bourne shell script    to test    out the    parseargs command!
  723.        #
  724. ***************
  725. *** 783,802 ****
  726.   
  727.        ##    parse command-line and save assignments    in a temporary file ##
  728.        parseargs -s sh -e    ARGUMENTS -u --    "$NAME"    "$@" >/tmp/tmp$$
  729. - Page 12
  730. - PARSEARGS(1)                         PARSEARGS(1)
  731.        if    [ $? -ne 0 ]
  732.          then rm -f /tmp/tmp$$; exit 2  ## non-zero status (usage    given)
  733.        fi
  734. --- 822,827 ----
  735. ***************
  736. *** 825,838 ****
  737.        Parseargs may exit    with one of the    following status codes:
  738.   
  739.   
  740.        -1      Some type of system error occurred during execution,
  741.         causing the program to exit prematurely.
  742.   
  743.        0      Normal exit status (no problems were encountered).
  744.   
  745. !      1      The calling program specified    the -U or the -M option
  746. !       to parseargs,    or specified an    argUsage flag on the
  747. !       command line.     Only the appropriate message is
  748.         displayed.
  749.   
  750.        2      A command line syntax    error was encountered by
  751. --- 850,876 ----
  752.        Parseargs may exit    with one of the    following status codes:
  753.   
  754.   
  755. + Page 13
  756. + PARSEARGS(1)                         PARSEARGS(1)
  757.        -1      Some type of system error occurred during execution,
  758.         causing the program to exit prematurely.
  759.   
  760.        0      Normal exit status (no problems were encountered).
  761.   
  762. !      1      The calling program specified    the -#,    the -U or the -M
  763. !       option to parseargs, or specified an argUsage    flag on
  764. !       the command line.  Only the appropriate message is
  765.         displayed.
  766.   
  767.        2      A command line syntax    error was encountered by
  768. ***************
  769. *** 848,868 ****
  770.        4      A syntax error was encountered in the    argument
  771.         specification    string that was    specified to parseargs.
  772.   
  773. - Page 13
  774. - PARSEARGS(1)                         PARSEARGS(1)
  775.   FILES
  776.        /usr/local/parseargs.pl
  777.         This file defines a perl function named parseargs to
  778. --- 886,891 ----
  779. ***************
  780. *** 892,897 ****
  781. --- 915,934 ----
  782.         -f-arg
  783.   
  784.        will properly assign the string ``-arg'' to the option
  785. + Page 14
  786. + PARSEARGS(1)                         PARSEARGS(1)
  787.        whereas the following:
  788.         -f -arg
  789.   
  790. ***************
  791. *** 916,934 ****
  792.        Hence multiple ``leading dash'' arguments may specified as
  793.        follows:
  794.   
  795. - Page 14
  796. - PARSEARGS(1)                         PARSEARGS(1)
  797.         -f-dash_arg1 -f-dash_arg2  ...
  798.   
  799.   BUGS
  800. --- 953,958 ----
  801. ***************
  802. *** 957,962 ****
  803. --- 981,1000 ----
  804.   
  805.        Parseargs cannot properly preserve    any newlines in    shell
  806.        variables if the eval command is used to read its output
  807. + Page 15
  808. + PARSEARGS(1)                         PARSEARGS(1)
  809.        (this is a    shortcoming of the eval    command, not of
  810.        parseargs). If the    user is    concerned about    this particular
  811.        case, then    the user should    redirect the output from
  812. ***************
  813. *** 966,975 ****
  814.        or    characters following a newline may be lost, in any
  815.        variables that are    set by parseargs.
  816.   
  817. -      Parseargs(1) is subject to    the same caveats as parseargs(3).
  818. -      Refer to the CAVEATS section of the parseargs(3) manual
  819. -      page(s) for more information.
  820.   AUTHOR
  821.        Brad Appleton  (brad@ssd.csd.harris.com)
  822.        Harris Computer Systems, Fort Lauderdale, FL USA
  823. --- 1004,1009 ----
  824. ***************
  825. *** 984,990 ****
  826.   
  827.   
  828.   
  829. ! Page 15
  830.   
  831.   
  832.   
  833. --- 1018,1056 ----
  834.   
  835.   
  836.   
  837. ! Page 16
  838.   
  839.   
  840.   
  841. *** /hx1d3/lp/brad/parseargs_patch03/parseargs/parseargs3.txt    Wed Apr 10 09:56:01 1991
  842. --- parseargs3.txt    Mon Apr 15 08:31:33 1991
  843. ***************
  844. *** 6,22 ****
  845.   
  846.   
  847.   NAME
  848. !      parseargs,    usage -    parse command line argument vectors
  849.   
  850.   SYNOPSIS
  851.        #include <parseargs.h>
  852.   
  853. !      int  parseargs(  char *argv[],  ARGDESC *argd  )
  854. !      int  fparseargs(  FILE *fp,  ARGDESC *argd     )
  855. !      int  lparseargs(  ArgList *argls,    ARGDESC    *argd  )
  856. !      int  sparseargs(  char *str,  ARGDESC *argd  )
  857. !      int  vparseargs(  ARGDESC *argd, int argc,     ...  )
  858. !      void  usage(  const ARGDESC *argd    )
  859.   
  860.   DESCRIPTION
  861.        Given a vector of string-valued arguments such as that
  862. --- 6,23 ----
  863.   
  864.   
  865.   NAME
  866. !      parseargs - parse command line argument vectors
  867.   
  868.   SYNOPSIS
  869.        #include <parseargs.h>
  870.   
  871. !      int  parseargs(  char *argv[],  ARGDESC *argd  );
  872. !      int  fparseargs(  FILE *fp,  ARGDESC *argd     );
  873. !      int  lparseargs(  ArgList *argls,    ARGDESC    *argd  );
  874. !      int  sparseargs(  char *str,  ARGDESC *argd  );
  875. !      int  vparseargs(  ARGDESC *argd, int argc,     ...  );
  876. !      void  usage(  const ARGDESC *argd    );
  877. !      extern  const char    *ProgName;
  878.   
  879.   DESCRIPTION
  880.        Given a vector of string-valued arguments such as that
  881. ***************
  882. *** 27,50 ****
  883.        argument values that are syntactically incorrect.
  884.   
  885.        Given a readable input stream and an argdesc array, fpar-
  886. !      seargs will parse arguments in a file in much the same
  887. !      manner as parseargs.  A maximum-line length of 255    charac-
  888. !      ters is imposed.  NO ``escaping'' of any kind is performed.
  889. !      Comments of a limited form    are permitted: if the first non-
  890. !      whitespace    character on a line is a '#' (or '!' for VMS)
  891. !      then that entire line is considered a comment and is
  892. !      ignored.  If a value is provided for an argument that is NOT
  893. !      a list or a vector, then the value    MUST be    on the same line
  894. !      as    the argument (in other words, ``-v val'' is fine but
  895. !      ``-v\nval'' is a not).
  896.   
  897.        Given an ArgList and an argdesc array, lparseargs will parse
  898. !      arguments in an ArgList in    much the same manner as    par-
  899. !      seargs.
  900.   
  901.        Given a single string and an argdesc array, sparseargs will
  902. !      parse arguments from a string in much the same manner as
  903. !      parseargs.     Sparseargs will split the given string    up into    a
  904.        vector of whitespace separated tokens and then attempt to
  905.        parse the resultant vector    as if it were given as argv[] on
  906.        the command-line.    NO special treatment is    given to charac-
  907. --- 28,50 ----
  908.        argument values that are syntactically incorrect.
  909.   
  910.        Given a readable input stream and an argdesc array, fpar-
  911. !      seargs will parse arguments in a file in the same manner as
  912. !      parseargs.     A maximum-line    length of 255 characters is
  913. !      imposed.  NO ``escaping'' of any kind is performed. Comments
  914. !      of    a limited form are permitted: if the first non-whitespace
  915. !      character on a line is a '#' (or '!' for VMS) then    that
  916. !      entire line is considered a comment and is    ignored.  If a
  917. !      value is provided for an argument that is NOT a list or a
  918. !      vector, then the value MUST be on the same    line as    the argu-
  919. !      ment (in other words, ``-v    val'' is fine but ``-v\nval'' is
  920. !      a not).
  921.   
  922.        Given an ArgList and an argdesc array, lparseargs will parse
  923. !      arguments in an ArgList in    the same manner    as parseargs.
  924.   
  925.        Given a single string and an argdesc array, sparseargs will
  926. !      parse arguments from a string in much the manner as par-
  927. !      seargs.  Sparseargs will split the    given string up    into a
  928.        vector of whitespace separated tokens and then attempt to
  929.        parse the resultant vector    as if it were given as argv[] on
  930.        the command-line.    NO special treatment is    given to charac-
  931. ***************
  932. *** 52,62 ****
  933.        Sparseargs    will always assume that    any whitespace characters
  934.        are intended as argument separators.
  935.   
  936.        Vparseargs    takes an argdesc array,    the number of arguments
  937.        to    parse, and a (possibly NULL terminated)    list of
  938. !      argument-strings and parses them in much the same manner as
  939. !      parseargs.     Unlike    sparseargs, vparseargs assumes that all
  940.   
  941.   
  942.   
  943. --- 52,62 ----
  944.        Sparseargs    will always assume that    any whitespace characters
  945.        are intended as argument separators.
  946.   
  947.        Vparseargs    takes an argdesc array,    the number of arguments
  948.        to    parse, and a (possibly NULL terminated)    list of
  949. !      argument-strings and parses them in the same manner as par-
  950. !      seargs.  Unlike sparseargs, vparseargs assumes that all
  951. !      parameters    are already split up into tokens, hence    any
  952.   
  953.   
  954.   
  955. ***************
  956. *** 71,86 ****
  957.   
  958.   
  959.   
  960. !      parameters    are already split up into tokens, hence    any whi-
  961. !      tespace characters    contained in any of the    string-parameters
  962. !      are used as is (and will be considered a part of an argument
  963. !      name or value).
  964.   
  965.        Given an argdesc array, usage will    print the usage    for the
  966.        given command in the format specified by the user's
  967.        USAGECNTL environment variable.
  968.   
  969.   THE ARGUMENT STRUCTURE
  970.        The basic type used by the    parseargs library is the argument
  971.        descriptor    (or "argdesc" for short). An ARGDESC structure is
  972. --- 71,90 ----
  973.   
  974.   
  975.   
  976. !      whitespace    characters contained in    any of the string-
  977. !      parameters    are used as is (and will be considered a part of
  978. !      an    argument name or value).
  979.   
  980.        Given an argdesc array, usage will    print the usage    for the
  981.        given command in the format specified by the user's
  982.        USAGECNTL environment variable.
  983.   
  984. +      After returning from any of the aforementioned functions,
  985. +      the global    string ProgName    will contain the name of the com-
  986. +      mand corresponding    to the argument-descriptor array that was
  987. +      most recently operated upon by one    the functions in the par-
  988. +      seargs(3) function    library.
  989.   THE ARGUMENT STRUCTURE
  990.        The basic type used by the    parseargs library is the argument
  991.        descriptor    (or "argdesc" for short). An ARGDESC structure is
  992. ***************
  993. *** 120,131 ****
  994.         this field must correspond to    the name of one    of the
  995.         argument type    functions described in argtype(3).
  996.   
  997. -      ARBPTR  ad_valp;
  998. -       This field is    a generic pointer to the storage used to
  999. -       represent the    internal value of the command-line
  1000.   
  1001.   
  1002.   Page 2
  1003.   
  1004.   
  1005. --- 124,131 ----
  1006. ***************
  1007. *** 137,149 ****
  1008.   
  1009.   
  1010.   
  1011. !       argument. It may be a    pointer    to a number, a boolean
  1012. !       value, a string, a list, or anything else for    which
  1013. !       there    exists a corresponding arg-type    function to use
  1014. !       in the ad_type field.    In the case of of parseargs(1)
  1015. !       this field must be the name of the corresponding shell
  1016. !       variable which will eventually hold the value    of the
  1017. !       argument given on the    command-line.
  1018.   
  1019.        const char     *ad_prompt;
  1020.         This field contains the long-name of the argument and
  1021. --- 137,152 ----
  1022.   
  1023.   
  1024.   
  1025. !      ARBPTR  ad_valp;
  1026. !       This field is    a generic pointer to the storage used to
  1027. !       represent the    internal value of the command-line argu-
  1028. !       ment.    It may be a pointer to a number, a boolean value,
  1029. !       a string, a list, or anything    else for which there
  1030. !       exists a corresponding arg-type function to use in the
  1031. !       ad_type field. In the    case of    of parseargs(1)    this
  1032. !       field    must be    the name of the    corresponding shell vari-
  1033. !       able which will eventually hold the value of the argu-
  1034. !       ment given on    the command-line.
  1035.   
  1036.        const char     *ad_prompt;
  1037.         This field contains the long-name of the argument and
  1038. ***************
  1039. *** 155,161 ****
  1040.         contains any uppercase characters, then the substring
  1041.         of long-name consisting of all uppercase characters is
  1042.         used as the argument keyword and the entire long-name
  1043. !       is used as the name of the argument (if a value my be
  1044.         supplied). The long-name may be matched by supplying a
  1045.         unique prefix    of either the argument keyword or the
  1046.         argument name.
  1047. --- 158,164 ----
  1048.         contains any uppercase characters, then the substring
  1049.         of long-name consisting of all uppercase characters is
  1050.         used as the argument keyword and the entire long-name
  1051. !       is used as the name of the argument (if a value may be
  1052.         supplied). The long-name may be matched by supplying a
  1053.         unique prefix    of either the argument keyword or the
  1054.         argument name.
  1055. ***************
  1056. *** 173,179 ****
  1057.          char *InFile;
  1058.          char *OutFile =       CHARNULL;
  1059.          BOOL XRated =  FALSE;
  1060. !        struct namelist *Files =    NULL;
  1061.   
  1062.          ARGDESC Args[] =
  1063.          {
  1064. --- 176,182 ----
  1065.          char *InFile;
  1066.          char *OutFile =       CHARNULL;
  1067.          BOOL XRated =  FALSE;
  1068. !        ArgList *Files =       ARGLISTNULL;
  1069.   
  1070.          ARGDESC Args[] =
  1071.          {
  1072. ***************
  1073. *** 183,197 ****
  1074.        ' ', ARGREQ,     argStr,  __ &InFile,    "INPUTfile {input file}",
  1075.        ' ', ARGOPT,     argStr,  __ &OutFile,    "OUTPUTfile {output file}",
  1076.        'X', ARGHIDDEN, argBool, __ &XRated,    "XratedMODE {naughty stuff!}",
  1077. !      ' ', ARGOPT|ARGLIST, argStr, __ &Files, "File {files to be read}",
  1078.        ENDOFARGS
  1079.          };
  1080.   
  1081.   
  1082.   
  1083.   Page 3
  1084.   
  1085.   
  1086. --- 186,197 ----
  1087.        ' ', ARGREQ,     argStr,  __ &InFile,    "INPUTfile {input file}",
  1088.        ' ', ARGOPT,     argStr,  __ &OutFile,    "OUTPUTfile {output file}",
  1089.        'X', ARGHIDDEN, argBool, __ &XRated,    "XratedMODE {naughty stuff!}",
  1090. !      ' ', ARGLIST,     listStr, __ &Files,    "File {files to    be read}",
  1091.        ENDOFARGS
  1092.          };
  1093.   
  1094.   
  1095.   
  1096.   Page 3
  1097.   
  1098.   
  1099. ***************
  1100. *** 379,386 ****
  1101.        arg_sdesc(ad)
  1102.         Return the description of an argument. If a description
  1103.         was supplied,    the ARGDESCRIBED flag will be set and the
  1104. !       description will immediately follow the terminating NUL
  1105. !       byte of the string name.
  1106.   
  1107.        ARG_isDESCRIBED(ad)
  1108.         Evaluates to TRUE only if an argument    description was
  1109. --- 379,386 ----
  1110.        arg_sdesc(ad)
  1111.         Return the description of an argument. If a description
  1112.         was supplied,    the ARGDESCRIBED flag will be set and the
  1113. !       description will immediately follow the terminating
  1114. !       NULL byte of the string name.
  1115.   
  1116.        ARG_isDESCRIBED(ad)
  1117.         Evaluates to TRUE only if an argument    description was
  1118. ***************
  1119. *** 448,454 ****
  1120.         usage    messages.
  1121.   
  1122.   CMD MACROS
  1123. !      Parseargs.h defines a set of macros to allow a more "self
  1124.        documenting" approach to declaring    argument-descriptor
  1125.        arrays. The "old-style" is    still accepted (but if used it is
  1126.        recommended that the STARTOFARGS macro is used in conjunc-
  1127. --- 448,454 ----
  1128.         usage    messages.
  1129.   
  1130.   CMD MACROS
  1131. !      <parseargs.h> defines a set of macros to allow a more "self
  1132.        documenting" approach to declaring    argument-descriptor
  1133.        arrays. The "old-style" is    still accepted (but if used it is
  1134.        recommended that the STARTOFARGS macro is used in conjunc-
  1135. ***************
  1136. *** 606,625 ****
  1137.        Ignore
  1138.         Ignore any unrecognized or improperly    specified
  1139.         command-line arguments and continue execution    of the
  1140. !       program. Normally, if    an argument is unmatched (or is
  1141. !       improperly specified), a usage message is printed and
  1142. !       program execution is terminated.
  1143.   
  1144.        OptsOnly
  1145.         Under    UNIX, setting this flag    will disable the parsing
  1146.         of long-option syntax. This will cause all arguments
  1147. !       starting with    '+' to always be treated as a positional
  1148.         parameter (instead of    a long-option).
  1149.   
  1150.        KwdsOnly
  1151.         Under    UNIX, setting this flag    disables the parsing of
  1152.         single-character options.  This will cause all argu-
  1153. !       ments    starting with '-' to always be treated as a posi-
  1154.         tional parameter (instead of an option).
  1155.   
  1156.        LoptsOnly
  1157. --- 606,625 ----
  1158.        Ignore
  1159.         Ignore any unrecognized or improperly    specified
  1160.         command-line arguments and continue execution    of the
  1161. !       program. Normally, if    a required argument is unmatched
  1162. !       (or an argument is improperly    specified), a usage mes-
  1163. !       sage is printed program execution is terminated.
  1164.   
  1165.        OptsOnly
  1166.         Under    UNIX, setting this flag    will disable the parsing
  1167.         of long-option syntax. This will cause all arguments
  1168. !       starting with    `+' to always be treated as a positional
  1169.         parameter (instead of    a long-option).
  1170.   
  1171.        KwdsOnly
  1172.         Under    UNIX, setting this flag    disables the parsing of
  1173.         single-character options.  This will cause all argu-
  1174. !       ments    starting with `-' to always be treated as a posi-
  1175.         tional parameter (instead of an option).
  1176.   
  1177.        LoptsOnly
  1178. ***************
  1179. *** 640,648 ****
  1180.         positional argument.
  1181.   
  1182.        CaseIgnore
  1183. !       Setting this flag causes character-case to be    ignored
  1184. !       when attempting to match single-character argument
  1185. !       names    (i.e. causes "-i" and "-I" will    be considered
  1186.         equivalent).
  1187.   
  1188.        If    the environment    variable ``PARSECNTL'' is empty    or unde-
  1189. --- 640,648 ----
  1190.         positional argument.
  1191.   
  1192.        CaseIgnore
  1193. !       Setting this flag will cause character-case to be
  1194. !       ignored when attempting to match single-character argu-
  1195. !       ment names (i.e. causes "-i" and "-I"    to be considered
  1196.         equivalent).
  1197.   
  1198.        If    the environment    variable ``PARSECNTL'' is empty    or unde-
  1199. ***************
  1200. *** 683,691 ****
  1201.        ferred to as ``terse'' mode). The other two ``modes'' con-
  1202.        trol the displaying of option syntax and long-option syntax.
  1203.        A mode may    be explicitly disabled by preceding its
  1204. !      corresponding string with the `!'    character. The ``modes''
  1205. !      which correspond to the possible values of    the ``USAGECNTL''
  1206. !      environment variable are given by the following table.
  1207.   
  1208.        Quiet
  1209.         No usage message of any kind is displayed.
  1210. --- 683,692 ----
  1211.        ferred to as ``terse'' mode). The other two ``modes'' con-
  1212.        trol the displaying of option syntax and long-option syntax.
  1213.        A mode may    be explicitly disabled by preceding its
  1214. !      corresponding string with the `!'    or `-' character. The
  1215. !      ``modes'' which correspond    to the possible    values of the
  1216. !      ``USAGECNTL'' environment variable    are given by the follow-
  1217. !      ing table.
  1218.   
  1219.        Quiet
  1220.         No usage message of any kind is displayed.
  1221. ***************
  1222. *** 719,725 ****
  1223.   
  1224.   
  1225.   
  1226.   Page 11
  1227.   
  1228.   
  1229. --- 720,725 ----
  1230. ***************
  1231. *** 759,766 ****
  1232.        vectors however need a set    of flags for each item they con-
  1233.        tain. Once    an arg-list has    been created, it may be    deallo-
  1234.        cated using the function listFree.    ListFree takes one param-
  1235. !      eter: first of which is the address of the    first item in the
  1236. !      arg-list.
  1237.   
  1238.        An    alternative to argument-lists is argument vectors (or
  1239.        arg-vectors).  Arg-vectors    use the    ARGVEC flag instead of
  1240. --- 759,765 ----
  1241.        vectors however need a set    of flags for each item they con-
  1242.        tain. Once    an arg-list has    been created, it may be    deallo-
  1243.        cated using the function listFree.    ListFree takes one param-
  1244. !      eter: the address of the first item in the    arg-list.
  1245.   
  1246.        An    alternative to argument-lists is argument vectors (or
  1247.        arg-vectors).  Arg-vectors    use the    ARGVEC flag instead of
  1248. ***************
  1249. *** 769,775 ****
  1250.        responsible for handling vectors of its type (although some
  1251.        argXxx functions such as the boolean types    do not support
  1252.        vectors). An arg-vector is    a structure which contains a
  1253. !      count, an array of    elements (i.e. an argc/argv pair), and an
  1254.        array of flags, one for each element of argv. There are two
  1255.        macros in defined in <parseargs.h>    which are used for arg-
  1256.        vectors. ARGVEC_T may be used to declare a    vector structure
  1257. --- 768,774 ----
  1258.        responsible for handling vectors of its type (although some
  1259.        argXxx functions such as the boolean types    do not support
  1260.        vectors). An arg-vector is    a structure which contains a
  1261. !      count, an array of    elements (i.e. an argc,argv pair), and an
  1262.        array of flags, one for each element of argv. There are two
  1263.        macros in defined in <parseargs.h>    which are used for arg-
  1264.        vectors. ARGVEC_T may be used to declare a    vector structure
  1265. ***************
  1266. *** 783,788 ****
  1267. --- 782,788 ----
  1268.   
  1269.         ( StrVec.array[ StrVec.count ] == (char *)NULL )
  1270.   
  1271. +      is    always true, and character-vectors will    always have an
  1272.   
  1273.   
  1274.   
  1275. ***************
  1276. *** 797,803 ****
  1277.   
  1278.   
  1279.   
  1280. -      is    always true, and character-vectors will    always have an
  1281.        extra NUL-character at the    end such that:
  1282.   
  1283.         ( CharVec.array[ CharVec.count ] == '\0' )
  1284. --- 797,802 ----
  1285. ***************
  1286. *** 849,854 ****
  1287. --- 848,854 ----
  1288.           printf(    "String[%d]=%s,    flags=%x\n",
  1289.               i, StrVec.array[i], StrVec.flags[i] );
  1290.   
  1291. +          for ( i = 0 ; i < NumVec.count ; i++ )
  1292.   
  1293.   
  1294.   
  1295. ***************
  1296. *** 863,869 ****
  1297.   
  1298.   
  1299.   
  1300. -          for ( i = 0 ; i < NumVec.count ; i++ )
  1301.           printf(    "Number[%d]=%s,    flags=%x\n",
  1302.               i, NumVec.array[i], NumVec.flags[i] );
  1303.   
  1304. --- 863,868 ----
  1305. ***************
  1306. *** 884,901 ****
  1307.   
  1308.         BOOL    argXxx(     ARGDESC *ad,  char *vp,  BOOL copyf  )
  1309.   
  1310. !      The argd argument points to the descriptor    for the    argument
  1311. !      being converted.  Its main    use is to find the location in
  1312. !      which to store the    converted value, located in
  1313. !      argd->ad_valp.  The string    value to be converted is passed
  1314. !      in    vp (which will be NULL if the ARGNOVAL flag was    set for
  1315. !      the corresponding entry in    the arg-descriptor table).  The
  1316. !      copyf flag    is TRUE    if the vp string value must be copied
  1317. !      when saved.  Most non-string types    are copied implicitly
  1318. !      (for example, integer arguments are stored    in binary form,
  1319. !      so    the original string value need not be saved), so this
  1320. !      argument can usually be ignored.  Put simply, this    flag is
  1321. !      TRUE when vp points to a temporary    buffer area.
  1322.   
  1323.        If    the type function successfully converts    the value, and
  1324.        uses the entire value, it should return TRUE.  If the type
  1325. --- 883,900 ----
  1326.   
  1327.         BOOL    argXxx(     ARGDESC *ad,  char *vp,  BOOL copyf  )
  1328.   
  1329. !      The ad argument points to the descriptor for the argument
  1330. !      being converted. Its main use is to find the location in
  1331. !      which to store the    converted value, located in ad->ad_valp.
  1332. !      The string    value to be converted is passed    in vp (which will
  1333. !      be    NULL if    the ARGNOVAL flag was set for the corresponding
  1334. !      entry in the arg-descriptor table).  The copyf flag is TRUE
  1335. !      if    the vp string value must be copied when    saved.    Most
  1336.