cc: [email protected]
Subject: Re: [ast-users] [ksh93] Please explain more about getopts' attributes
`listof', `oneof' and `ignorecase' in the manual
--------
>
> $ echo ${.sh.version}
> Version jM 93u 2011-02-08
> $ getopts --man
> ... ...
> 3. An option argument specification. Options that take arguments can
> be
> followed by : (string value) or # (numeric value) and an option
> argument specification. An option argument specification consists
> of
> the option argument name as field 1. The remaining : separated
> fields
> are a type name and zero or more of the special attribute words
> listof, oneof, and ignorecase. A default option value may be
> specified in the final field as :=default. The option argument
> specification may be followed by a list of option value
> descriptions
> enclosed in braces. A long option that takes an argument is
> specified
> as --longname=value. If the : or # is followed by ? then the
> option
> argument is optional. If only the option character form is
> specified
> then the optional argument value is not set if the next argument
> starts with - or +.
> ... ...
> $
>
> Here it's not clear what "listof, oneof and ignorecase" means and how it
> would be used. Please clarify more.
>
> (See also the discussion @comp.unix.shell:
> https://groups.google.com/d/msg/comp.unix.shell/lOWZPy_22pI/5d8E-xu6d1UJ )
>
> -Clark
>
Section 5 describes how to define a list.
5. A argument specification. A list of valid option argument values can
be specified by enclosing them inside a {...} following the option
argument specification. Each of the permitted values can be specified
with a [...] containing the value followed by a description.
You can include a list in the specification of an option argument.
ignorecase means that the items on the list are case insensitive.
listof means that the option argument can be a subset of the items in the list.
oneof means that the option argument is one of the items in the list.
David Korn
[email protected]
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users