3 function psi\opterr(int $value) : void {
4 let opterr = intval($value);
5 return opterr_set(opterr) as void(opterr_set);
7 function psi\optind\get() : int {
8 return optind_get() as to_int(optind_get);
10 function psi\optind\set(int $v) : void {
11 let optind = intval($v);
12 return optind_set(optind) as void(optind_set);
14 function psi\optopt() : int {
15 return optopt_get() as to_int(optopt_get);
17 function psi\optarg() : string {
18 return optarg_get() as to_string(optarg_get);
22 function psi\optreset() : void {
24 return optreset_set(_v) as void(optreset_set);
28 static function psi\getopt(array &$argv, string $options) : int {
29 let argc = count($argv);
30 let argv = &arrval($argv,
33 let optstring = strval($options);
34 return getopt(argc, argv, optstring) as to_int(getopt);