X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plcsh;fp=plcsh;h=e18c1d46c83e9ec40bb1de0c1b1600e993c4642d;hb=b7256c920803df5876b7fdbb0ce15e2bebc320a9;hp=10944b07fe0521414c26baa7e80e6a3dabccfb6c;hpb=ee0717f6f326f2b1bcf34e8b10e306adb21f4ffa;p=plcapi.git diff --git a/plcsh b/plcsh index 10944b0..e18c1d4 100755 --- a/plcsh +++ b/plcsh @@ -59,11 +59,15 @@ except Exception, err: parser.print_help() sys.exit(1) -# If called by a script -if len(sys.argv) > 1 and os.path.exists(sys.argv[1]): +# If called by a script or api call is passed +if len(sys.argv) > 1: # Pop us off the argument stack sys.argv.pop(0) - execfile(sys.argv[0]) + if os.path.exists(sys.argv[0]) and os.path.isfile(sys.argv[0]): + execfile(sys.argv[0]) + else: + print eval(sys.argv[0]) + sys.exit(0) # Otherwise, run an interactive shell environment else: