home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume30 / parseargs / patch12 / PATCH12
Encoding:
Text File  |  1992-06-20  |  10.1 KB  |  286 lines

  1. *** Makefile.OLD    Thu May 21 11:06:41 1992
  2. --- Makefile    Mon May 18 12:15:47 1992
  3. ***************
  4. *** 22,28 ****
  5.   LOCAL =  /usr/local
  6.   LIBDIR = ${LOCAL}/lib
  7.   INCDIR = ${LOCAL}/include
  8. ! PERLLIB = ${LIB}/perl
  9.   
  10.   ###
  11.   # compilation options
  12. --- 22,28 ----
  13.   LOCAL =  /usr/local
  14.   LIBDIR = ${LOCAL}/lib
  15.   INCDIR = ${LOCAL}/include
  16. ! PERLLIB = ${LIBDIR}/perl
  17.   
  18.   ###
  19.   # compilation options
  20. ***************
  21. *** 101,107 ****
  22.           doc/vparseargs3.inc
  23.   SCRIPTS =    test.sh  test.csh  test.ksh  test.rc  test.awk  test.pl
  24.   PERLSUB =    ${NAME}.pl
  25. ! XXFILES =    Intro  README  MANIFEST  Makefile  Makefile.cpp
  26.   
  27.   HDRS =    ${NAME}.h \
  28.           patchlevel.h \
  29. --- 101,107 ----
  30.           doc/vparseargs3.inc
  31.   SCRIPTS =    test.sh  test.csh  test.ksh  test.rc  test.awk  test.pl
  32.   PERLSUB =    ${NAME}.pl
  33. ! XXFILES =    Intro  README  MANIFEST  Makefile  VMSbuild.com
  34.   
  35.   HDRS =    ${NAME}.h \
  36.           patchlevel.h \
  37. *** doc/sh_arrays.inc.OLD    Thu May 21 11:07:07 1992
  38. --- doc/sh_arrays.inc    Mon May 18 11:54:44 1992
  39. ***************
  40. *** 199,210 ****
  41.   .ft R
  42.   .RE
  43.   .fi
  44.   .SS "A Final Note on Argument Lists"
  45.   .PP
  46. ! The word-lists used by the C and Z shells, the arrays used by the Korn shell,
  47. ! the Plan 9 shell, \fIawk\fP, \fIperl\fP, and the positional parameters used by
  48. ! all shells (if overwritten by \fBparseargs\fP) will preserve any \s-1IFS\s+1
  49. ! characters in their contents.  That is to say that if an item in one of the
  50. ! aforementioned multi-word lists contains any \s-1IFS\s+1 characters, it will
  51. ! not be split up into multiple items but will remain a single item which
  52. ! contains \s-1IFS\s+1 characters.
  53. --- 199,221 ----
  54.   .ft R
  55.   .RE
  56.   .fi
  57. + .SS "Tcl Argument Lists"
  58. + .PP
  59. + For \fItcl\fP, each argument list is considered a list and is set using 
  60. + the following syntax:
  61. + .nf
  62. + .RS
  63. + .ft 4
  64. + set name [ list 'arg1'  'arg2'   ... ] ;
  65. + .ft R
  66. + .RE
  67. + .fi
  68.   .SS "A Final Note on Argument Lists"
  69.   .PP
  70. ! The word-lists used by the \fIcsh\fP and \fIzsh\fP, the arrays used by
  71. ! \fIksh\fP, \fIrc\fP, \fIawk\fP, \fIperl\fP, \fItcl\fP, and the positional
  72. ! parameters used by all shells (if overwritten by \fBparseargs\fP) will
  73. ! preserve any \s-1IFS\s+1 characters in their contents.  That is to say that
  74. ! if an item in one of the aforementioned multi-word lists contains any
  75. ! \s-1IFS\s+1 characters, it will not be split up into multiple items but
  76. ! will remain a single item which contains \s-1IFS\s+1 characters.
  77. *** parseargs.c.OLD    Thu May 21 11:07:24 1992
  78. --- parseargs.c    Mon May 18 12:03:13 1992
  79. ***************
  80. *** 1700,1709 ****
  81.   **    for setting up an argument list depends largely upon the syntax of
  82.   **    shell that was specified on the command line via the -s option
  83.   **    (although ARGLIST arguments are treated exactly the same as ARGVEC
  84. ! **    arguments).  With the exception perl which always uses a comma to
  85. ! **    separate array elements, all shells will use the string specified
  86. ! **    with the -S option as the field separator between elements of an
  87. ! **    array (the default field separator is a space character).
  88.   **
  89.   ** ^Resetting_the_Positional_Parameters_to_an_Argument_List:
  90.   **    For the Bourne, Bourne-Again, and Korn shells, if the variable name
  91. --- 1700,1709 ----
  92.   **    for setting up an argument list depends largely upon the syntax of
  93.   **    shell that was specified on the command line via the -s option
  94.   **    (although ARGLIST arguments are treated exactly the same as ARGVEC
  95. ! **    arguments). With the exception of perl which always uses a comma to
  96. ! **    separate array elements, all shells will use the string specified with
  97. ! **    the -S option as the field separator between elements of an array (the
  98. ! **    default field separator is a space character).
  99.   **
  100.   ** ^Resetting_the_Positional_Parameters_to_an_Argument_List:
  101.   **    For the Bourne, Bourne-Again, and Korn shells, if the variable name
  102. ***************
  103. *** 1722,1729 ****
  104.   **    to the contents of the argument list.
  105.   **
  106.   **    For the Plan 9 shell (rc), if the variable name corresponding to the
  107. ! **    ARGLIST argument is "*", then the positional parameters of then calling
  108. ! **    program will be re-assigned to the contents of the argument list.
  109.   **
  110.   **    For awk and perl, if the variable name corresponding to the ARGLIST
  111.   **    argument is "ARGV", then the positional parameters of the calling
  112. --- 1722,1730 ----
  113.   **    to the contents of the argument list.
  114.   **
  115.   **    For the Plan 9 shell (rc), if the variable name corresponding to the
  116. ! **    ARGLIST argument is "*", then the positional parameters of the
  117. ! **    calling program will be re-assigned to the contents of the argument
  118. ! **    list.
  119.   **
  120.   **    For awk and perl, if the variable name corresponding to the ARGLIST
  121.   **    argument is "ARGV", then the positional parameters of the calling
  122. ***************
  123. *** 1843,1856 ****
  124.   **
  125.   **         @name=( 'arg1' , 'arg2' ,  ... );
  126.   **
  127.   ** ^A_Final_Note_on_Argument_Lists:
  128. ! **    The word-lists used by the C and Z shells, the arrays used by the Korn
  129. ! **    shell, the Plan 9 shell, awk, perl, and the positional parameters used
  130. ! **    by all shells (if overwritten by parseargs) will preserve any IFS
  131. ! **    characters in their contents.  That is to say that if an item in one
  132. ! **    of the aforementioned multi-word lists contains any IFS characters, it
  133. ! **    will not be split up into multiple items but will remain a single item
  134. ! **    which contains IFS characters.
  135.   **
  136.   ** ^REQUIREMENTS:
  137.   **    <val> should correspond to the vlue of the argument indicated by <ad>
  138. --- 1844,1872 ----
  139.   **
  140.   **         @name=( 'arg1' , 'arg2' ,  ... );
  141.   **
  142. + ** ^Tcl_Argument_Lists:
  143. + **    For tcl, each argument list is considered a list and is set using the
  144. + **    following syntax:
  145. + **
  146. + **         set name [ list 'arg1'  'arg2'   ... ] ;
  147. + **
  148.   ** ^A_Final_Note_on_Argument_Lists:
  149. ! **    The word-lists used by the csh and zsh, the arrays used by ksh, rc,
  150. ! **    awk, perl, tcl, and the positional parameters used by all shells (if
  151. ! **    overwritten by parseargs) will preserve any IFS characters in their
  152. ! **    contents.  That is to say that if an item in one of the aforementioned
  153. ! **    multi-word lists contains any IFS characters, it will not be split up
  154. ! **    into multiple items but will remain a single item which contains IFS
  155. ! **    characters.
  156. ! **
  157. ! **    Parseargs treats ARGLIST arguments in a special way. The method used
  158. ! **    for setting up an argument list depends largely upon the syntax of
  159. ! **    shell that was specified on the command line via the -s option
  160. ! **    (although ARGLIST arguments are treated exactly the same as ARGVEC
  161. ! **    arguments).  With the exception perl which always uses a comma to
  162. ! **    separate array elements, all shells will use the string specified
  163. ! **    with the -S option as the field separator between elements of an
  164. ! **    array (the default field separator is a space character).
  165.   **
  166.   ** ^REQUIREMENTS:
  167.   **    <val> should correspond to the vlue of the argument indicated by <ad>
  168. *** patchlevel.h.OLD    Thu May 21 11:07:39 1992
  169. --- patchlevel.h    Thu May 21 11:06:03 1992
  170. ***************
  171. *** 3,8 ****
  172. --- 3,14 ----
  173.   **
  174.   ** ^HISTORY:
  175.   **
  176. + **    05/18/92    Brad Appleton    <brad@ssd.csd.harris.com>
  177. + **    Patch12
  178. + **    - Fixes to the Makefile and for tcl.
  179. + **    - Added tcl to the documentation
  180. + **    - Fixed error in strfuncs.h for strndup prototypes.
  181. + **
  182.   **    01/02/92    Brad Appleton    <brad@ssd.csd.harris.com>
  183.   **    Patch11
  184.   **    - Added strndup() to strfuncs.[ch]
  185. ***************
  186. *** 155,161 ****
  187.   
  188.   #define  VERSION     2
  189.   #define  REVISION    0
  190. ! #define  PATCHLEVEL  11
  191.   
  192.   #ifdef __STDC__
  193.      static const char
  194. --- 161,167 ----
  195.   
  196.   #define  VERSION     2
  197.   #define  REVISION    0
  198. ! #define  PATCHLEVEL  12
  199.   
  200.   #ifdef __STDC__
  201.      static const char
  202. ***************
  203. *** 162,165 ****
  204.   #else
  205.      static char
  206.   #endif
  207. !    _Ident[] = "@(#)parseargs  2.0  patchlevel 11";
  208. --- 168,171 ----
  209.   #else
  210.      static char
  211.   #endif
  212. !    _Ident[] = "@(#)parseargs  2.0  patchlevel 12";
  213. *** strfuncs.h.OLD    Thu May 21 11:07:49 1992
  214. --- strfuncs.h    Mon May 18 14:29:59 1992
  215. ***************
  216. *** 23,30 ****
  217.   EXTERN  char  *strlwr       ARGS(( char * ));
  218.   EXTERN  int    stricmp      ARGS(( const char *, const char * ));
  219.   EXTERN  int    strnicmp     ARGS(( const char *, const char *, size_t ));
  220. ! EXTERN  char  *strndup      ARGS(( const char * ));
  221. ! EXTERN  char  *strndup      ARGS(( const char * ));
  222.   EXTERN  char  *strdup       ARGS(( const char * ));
  223.   
  224.   #ifdef BSD
  225. --- 23,30 ----
  226.   EXTERN  char  *strlwr       ARGS(( char * ));
  227.   EXTERN  int    stricmp      ARGS(( const char *, const char * ));
  228.   EXTERN  int    strnicmp     ARGS(( const char *, const char *, size_t ));
  229. ! EXTERN  char  *strdup       ARGS(( const char * ));
  230. ! EXTERN  char  *strndup      ARGS(( const char *, unsigned len ));
  231.   EXTERN  char  *strdup       ARGS(( const char * ));
  232.   
  233.   #ifdef BSD
  234. *** test.tcl.OLD    Thu May 21 11:07:59 1992
  235. --- test.tcl    Mon May 18 14:45:39 1992
  236. ***************
  237. *** 31,46 ****
  238.   eval [ parseargs -u -a $arguments $scriptName $argv ]
  239.   
  240.   ## print  the parsed arguments (use defaults if not defined)
  241. ! puts stdout "ARGUMENTS:"
  242. ! puts stdout "=========="
  243. ! puts stdout "Groups = $groups"
  244. ! puts stdout "Count = $count"
  245. ! puts stdout "Directory = $dirname"
  246. ! puts stdout "XFlag = $xflag"
  247. ! puts stdout "YFlag = $yflag"
  248. ! puts stdout "SepChar = $sepch"
  249. ! puts stdout "Name = $name"
  250. ! puts stdout "Files = $files"
  251.   if {( "$string_flag" != "") } {
  252.     if {( "$string" == "" )} {
  253.       set string "!string arg ommitted on cmd-line!"
  254. --- 31,46 ----
  255.   eval [ parseargs -u -a $arguments $scriptName $argv ]
  256.   
  257.   ## print  the parsed arguments (use defaults if not defined)
  258. ! echo "ARGUMENTS:"
  259. ! echo "=========="
  260. ! echo "Groups = $groups"
  261. ! echo "Count = $count"
  262. ! echo "Directory = $dirname"
  263. ! echo "XFlag = $xflag"
  264. ! echo "YFlag = $yflag"
  265. ! echo "SepChar = $sepch"
  266. ! echo "Name = $name"
  267. ! echo "Files = $files"
  268.   if {( "$string_flag" != "") } {
  269.     if {( "$string" == "" )} {
  270.       set string "!string arg ommitted on cmd-line!"
  271. ***************
  272. *** 48,53 ****
  273.   } else {
  274.     set string "default string"
  275.   }
  276. ! puts stdout "String = $string"
  277. ! puts stdout "argv = $argv"
  278.   
  279. --- 48,53 ----
  280.   } else {
  281.     set string "default string"
  282.   }
  283. ! echo "String = $string"
  284. ! echo "argv = $argv"
  285.   
  286.