home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
rftp.zip
/
init_get.3r
< prev
next >
Wrap
Text File
|
1995-08-15
|
3KB
|
76 lines
init_getopt(3r) init_getopt(3r)
───────────────────────────────────────────────────────────────────────────────
NAME
init_getopt - Parse and store command line arguments
SYNOPSIS
parse arg argv
int = init_getopt( argv )
.
.
.
init_getopt: procedure expose getopt.
parse arg arglist
DESCRIPTION
init_getopt parses the command line arguments to a REXX program and
stores them in the global stem variable getopt. in a format usable by
the getopt subroutine. init_getopt stores the program name in
getopt.!program, the first argument after the program name in
getopt.1, the second in getopt.2, and so on. The total number of
arguments is stored in getopt.0.
This routine can handle quoted arguments. That is, the string "This
is one argument" will be considered one argument instead of four.
GLOBAL VARIABLES
init_getopt uses a stem variable named getopt., which contains the
following stems:
getopt.0
Specifies the number of parameters passed to the program.
getopt.1 through getopt.n
Specifies the list of parameters passed to the program.
getopt.!optarg
getopt.!opterr
getopt.!optind
getopt.!optopt
getopt.!sp
Initialized for use by getopt.
RETURN VALUES
The init_getopt subroutine returns the number of arguments entered on
the command line. init_getopt returns -1 if the command line contains
unbalanced quotation marks.
NOTES
init_getopt does not handle quoted quotation marks (\"), and does not
do wildcard expansion.
SEE ALSO
getopt(3r)
PROGRAM AUTHOR
Lawrence R. "Rod" Buchanan
COPYRIGHT
Copyright (c) 1994-95 Lawrence R Buchanan. ALL RIGHTS RESERVED.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.