Lines Matching refs:args
51 def getopt(args, shortopts, longopts = []): argument
83 while args and args[0].startswith('-') and args[0] != '-':
84 if args[0] == '--':
85 args = args[1:]
87 if args[0].startswith('--'):
88 opts, args = do_longs(opts, args[0][2:], longopts, args[1:])
90 opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])
92 return opts, args
94 def gnu_getopt(args, shortopts, longopts = []): argument
125 while args:
126 if args[0] == '--':
127 prog_args += args[1:]
130 if args[0][:2] == '--':
131 opts, args = do_longs(opts, args[0][2:], longopts, args[1:])
132 elif args[0][:1] == '-' and args[0] != '-':
133 opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])
136 prog_args += args
139 prog_args.append(args[0])
140 args = args[1:]
144 def do_longs(opts, opt, longopts, args): argument
155 if not args:
157 optarg, args = args[0], args[1:]
161 return opts, args
187 def do_shorts(opts, optstring, shortopts, args): argument
192 if not args:
195 optstring, args = args[0], args[1:]
200 return opts, args