~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzr.py

  • Committer: mbp at sourcefrog
  • Date: 2005-03-12 07:34:32 UTC
  • Revision ID: mbp@sourcefrog.net-20050312073432-b2c16a55e0d6e9fb
fix StopIteration error on python2.3(?)

Show diffs side-by-side

added added

removed removed

Lines of Context:
608
608
 
609
609
    # TODO: Maybe handle '--' to end options?
610
610
 
611
 
    it = iter(argv[1:])
612
 
    while it:
613
 
        a = it.next()
 
611
    while argv:
 
612
        a = argv.pop(0)
614
613
        if a[0] == '-':
615
614
            optarg = None
616
615
            if a[1] == '-':
634
633
            optargfn = OPTIONS[optname]
635
634
            if optargfn:
636
635
                if optarg == None:
637
 
                    if not it:
 
636
                    if not argv:
638
637
                        bailout('option %r needs an argument' % a)
639
638
                    else:
640
 
                        optarg = it.next()
 
639
                        optarg = argv.pop(0)
641
640
                opts[optname] = optargfn(optarg)
642
641
                mutter("    option argument %r" % opts[optname])
643
642
            else:
668
667
    argdict = {}
669
668
    # TODO: Need a way to express 'cp SRC... DEST', where it matches
670
669
    # all but one.
 
670
 
671
671
    for ap in argform:
672
672
        argname = ap[:-1]
673
673
        if ap[-1] == '?':
705
705
    logging and error handling.
706
706
    """
707
707
    try:
708
 
        args, opts = parse_args(argv)
 
708
        args, opts = parse_args(argv[1:])
709
709
        if 'help' in opts:
710
710
            # TODO: pass down other arguments in case they asked for
711
711
            # help on a command name?