INNER CODE UNIT · Go
getopt
lh3/gfatools · gfa-server.go:52
func getopt(args []string, ostr string) (int, string) {
if getopt_place == -1 { // update scanning pointer
if optind >= len(args) || args[optind][0] != '-' {
getopt_place = -1
return -1, ""
}
if optind < len(args) {
getopt_place = 0
}
if getopt_place + 1 < len(args[optind]) {
getopt_place += 1
if args[optind][getopt_place] == '-' { // found "--"
optind += 1
getopt_place = -1
return -1, ""
}
}
}