mercurial/dispatch.py
branchstable
changeset 19098 f01ae031f84c
parent 19011 12acbea17625
child 19099 fc081623f4bd
equal deleted inserted replaced
19097:3f5e75c22585 19098:f01ae031f84c
   483 def _earlygetopt(aliases, args):
   483 def _earlygetopt(aliases, args):
   484     """Return list of values for an option (or aliases).
   484     """Return list of values for an option (or aliases).
   485 
   485 
   486     The values are listed in the order they appear in args.
   486     The values are listed in the order they appear in args.
   487     The options and values are removed from args.
   487     The options and values are removed from args.
       
   488 
       
   489     >>> args = ['x', '--cwd', 'foo', 'y']
       
   490     >>> _earlygetopt(['--cwd'], args), args
       
   491     (['foo'], ['x', 'y'])
       
   492 
       
   493     >>> args = ['x', '-R', 'foo', 'y']
       
   494     >>> _earlygetopt(['-R'], args), args
       
   495     (['foo'], ['x', 'y'])
       
   496 
       
   497     >>> args = ['x', '-Rbar', 'y']
       
   498     >>> _earlygetopt(['-R'], args), args
       
   499     (['bar'], ['x', 'y'])
   488     """
   500     """
   489     try:
   501     try:
   490         argcount = args.index("--")
   502         argcount = args.index("--")
   491     except ValueError:
   503     except ValueError:
   492         argcount = len(args)
   504         argcount = len(args)