• Home
  • Raw
  • Download

Lines Matching refs:go

305 	Getopt go;  in parse_args()  local
356 ksh_getopt_reset(&go, GF_ERROR|GF_PLUSOPT); in parse_args()
357 while ((optc = ksh_getopt(argv, &go, opts)) != -1) { in parse_args()
358 set = tobool(!(go.info & GI_PLUS)); in parse_args()
364 array = go.optarg; in parse_args()
370 if (go.optarg == NULL) { in parse_args()
381 i = option(go.optarg); in parse_args()
393 bi_errorf("%s: %s", go.optarg, "bad option"); in parse_args()
406 chvt(go.optarg); in parse_args()
432 if (!(go.info & GI_MINUSMINUS) && argv[go.optind] && in parse_args()
433 (argv[go.optind][0] == '-' || argv[go.optind][0] == '+') && in parse_args()
434 argv[go.optind][1] == '\0') { in parse_args()
436 if (argv[go.optind][0] == '-') in parse_args()
439 go.optind++; in parse_args()
443 *setargsp = !arrayset && ((go.info & GI_MINUSMINUS) || in parse_args()
444 argv[go.optind]); in parse_args()
458 for (i = go.optind; argv[i]; i++) in parse_args()
460 qsort(&argv[go.optind], i - go.optind, sizeof(void *), in parse_args()
464 go.optind += set_array(array, tobool(arrayset > 0), in parse_args()
465 argv + go.optind); in parse_args()
467 return (go.optind); in parse_args()
912 ksh_getopt_reset(Getopt *go, int flags) in ksh_getopt_reset() argument
914 go->optind = 1; in ksh_getopt_reset()
915 go->optarg = NULL; in ksh_getopt_reset()
916 go->p = 0; in ksh_getopt_reset()
917 go->flags = flags; in ksh_getopt_reset()
918 go->info = 0; in ksh_getopt_reset()
919 go->buf[1] = '\0'; in ksh_getopt_reset()
949 ksh_getopt(const char **argv, Getopt *go, const char *optionsp) in ksh_getopt() argument
954 if (go->p == 0 || (c = argv[go->optind - 1][go->p]) == '\0') { in ksh_getopt()
955 const char *arg = argv[go->optind], flag = arg ? *arg : '\0'; in ksh_getopt()
957 go->p = 1; in ksh_getopt()
959 go->optind++; in ksh_getopt()
960 go->p = 0; in ksh_getopt()
961 go->info |= GI_MINUSMINUS; in ksh_getopt()
967 (!(go->flags & GF_PLUSOPT) || flag != '+')) || in ksh_getopt()
969 go->p = 0; in ksh_getopt()
972 go->optind++; in ksh_getopt()
973 go->info &= ~(GI_MINUS|GI_PLUS); in ksh_getopt()
974 go->info |= flag == '-' ? GI_MINUS : GI_PLUS; in ksh_getopt()
976 go->p++; in ksh_getopt()
980 go->buf[0] = c; in ksh_getopt()
981 go->optarg = go->buf; in ksh_getopt()
984 (go->flags & GF_NONAME) ? "" : argv[0], in ksh_getopt()
985 (go->flags & GF_NONAME) ? "" : ": ", c, in ksh_getopt()
987 if (go->flags & GF_ERROR) in ksh_getopt()
999 if (argv[go->optind - 1][go->p]) in ksh_getopt()
1000 go->optarg = argv[go->optind - 1] + go->p; in ksh_getopt()
1001 else if (argv[go->optind]) in ksh_getopt()
1002 go->optarg = argv[go->optind++]; in ksh_getopt()
1004 go->optarg = NULL; in ksh_getopt()
1007 go->buf[0] = c; in ksh_getopt()
1008 go->optarg = go->buf; in ksh_getopt()
1012 (go->flags & GF_NONAME) ? "" : argv[0], in ksh_getopt()
1013 (go->flags & GF_NONAME) ? "" : ": ", c, in ksh_getopt()
1015 if (go->flags & GF_ERROR) in ksh_getopt()
1019 go->p = 0; in ksh_getopt()
1022 go->optarg = argv[go->optind - 1] + go->p; in ksh_getopt()
1023 go->p = 0; in ksh_getopt()
1030 if (argv[go->optind - 1][go->p]) { in ksh_getopt()
1031 if (ksh_isdigit(argv[go->optind - 1][go->p])) { in ksh_getopt()
1032 go->optarg = argv[go->optind - 1] + go->p; in ksh_getopt()
1033 go->p = 0; in ksh_getopt()
1035 go->optarg = NULL; in ksh_getopt()
1037 if (argv[go->optind] && ksh_isdigit(argv[go->optind][0])) { in ksh_getopt()
1038 go->optarg = argv[go->optind++]; in ksh_getopt()
1039 go->p = 0; in ksh_getopt()
1041 go->optarg = NULL; in ksh_getopt()