Home | History | Annotate | Download | only in python2.7

Lines Matching refs:args

51 def getopt(args, shortopts, longopts = []):
52 """getopt(args, options[, long_options]) -> opts, args
54 Parses command line options and parameter list. args is the
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 = []):
95 """getopt(args, options[, long_options]) -> opts, args
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):
155 if not args:
157 optarg, args = args[0], args[1:]
161 return opts, args
187 def do_shorts(opts, optstring, shortopts, args):
192 if not args:
195 optstring, args = args[0], args[1:]
200 return opts, args