home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / rftp.zip / init_get.3r < prev    next >
Text File  |  1995-08-15  |  3KB  |  76 lines

  1.  
  2. init_getopt(3r)                                                 init_getopt(3r)
  3. ───────────────────────────────────────────────────────────────────────────────
  4.  
  5. NAME
  6.      init_getopt - Parse and store command line arguments
  7.  
  8. SYNOPSIS
  9.      parse arg argv
  10.      int = init_getopt( argv )
  11.      .
  12.      .
  13.      .
  14.      init_getopt: procedure expose getopt.
  15.          parse arg arglist
  16.  
  17. DESCRIPTION
  18.      init_getopt parses the command line arguments to a REXX program and 
  19.      stores them in the global stem variable getopt. in a format usable by 
  20.      the getopt subroutine.  init_getopt stores the program name in 
  21.      getopt.!program, the first argument after the program name in 
  22.      getopt.1, the second in getopt.2, and so on.  The total number of 
  23.      arguments is stored in getopt.0.
  24.  
  25.      This routine can handle quoted arguments.  That is, the string "This 
  26.      is one argument" will be considered one argument instead of four.
  27.  
  28. GLOBAL VARIABLES
  29.      init_getopt uses a stem variable named getopt., which contains the 
  30.      following stems:
  31.  
  32.      getopt.0
  33.           Specifies the number of parameters passed to the program.
  34.  
  35.      getopt.1 through getopt.n
  36.           Specifies the list of parameters passed to the program.
  37.  
  38.      getopt.!optarg
  39.      getopt.!opterr
  40.      getopt.!optind
  41.      getopt.!optopt
  42.      getopt.!sp
  43.           Initialized for use by getopt.
  44.  
  45. RETURN VALUES
  46.      The init_getopt subroutine returns the number of arguments entered on 
  47.      the command line.  init_getopt returns -1 if the command line contains
  48.      unbalanced quotation marks.
  49.  
  50. NOTES
  51.      init_getopt does not handle quoted quotation marks (\"), and does not 
  52.      do wildcard expansion.
  53.  
  54. SEE ALSO
  55.      getopt(3r)
  56.  
  57. PROGRAM AUTHOR
  58.      Lawrence R. "Rod" Buchanan
  59.  
  60. COPYRIGHT
  61.      Copyright (c) 1994-95 Lawrence R Buchanan.  ALL RIGHTS RESERVED.
  62.  
  63.      This program is free software; you can redistribute it and/or modify
  64.      it under the terms of the GNU General Public License as published by
  65.      the Free Software Foundation; either version 2, or (at your option)
  66.      any later version.
  67.  
  68.      This program is distributed in the hope that it will be useful,
  69.      but WITHOUT ANY WARRANTY; without even the implied warranty of
  70.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  71.      GNU General Public License for more details.
  72.  
  73.      You should have received a copy of the GNU General Public License
  74.      along with this program; if not, write to the Free Software
  75.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  76.