Changeset 762

Show
Ignore:
Timestamp:
07/22/07 01:34:17 (1 year ago)
Author:
robin
Message:

a few command line fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pyrun/trunk/pyrun.py

    r761 r762  
    417417            # All pyrun options are short options. 
    418418            nextopt = argv[ia][1:] 
    419             if nextopt in default_opts: 
     419            if nextopt in default_opts and ( 
     420                    getattr(opts, nextopt) == default_opts[nextopt]): 
    420421 
    421422                # It's possibly a pyrun option. 
     
    483484            import code 
    484485            code.interact(banner=banner, local=locals()) 
     486 
     487        # If we were not in interactive mode and the print path options 
     488        # is set, print it. 
    485489        if pthextend and opts.p and not opts.i: 
    486490            for p in pthextend: 
    487491                print p 
     492 
     493        # If we were not in interactive mode and the print PYTHONPATH 
     494        # option is set, print it 
    488495        if pthextend and opts.P and not opts.i: 
    489496            print os.pathsep.join(pthextend) 
    490497 
    491         if not (opts.n or opts.d or opts.i) and opts.m: 
    492             return run_module() 
     498        if not (opts.n or opts.d or opts.i) and modname: 
     499            exitval = run_module() 
     500            if not isinstance(exitval, int): 
     501                return 0 
     502            return exitval 
    493503        return 0 
    494504