Permalink
Browse files

support running as -osh for use as login shell (#35)

  • Loading branch information...
icarroll authored and andychu committed Sep 12, 2017
1 parent c9bb39a commit bee2d0fc102cc60375065d51ad31bc1ea833e5c8
Showing with 10 additions and 2 deletions.
  1. +10 −2 bin/oil.py
View
@@ -164,7 +164,7 @@ def _ShowVersion():
print('Platform: %s' % platform.version())
def OshMain(argv):
def OshMain(argv, login_shell):
spec = args.FlagsAndOptions()
spec.ShortFlag('-c', args.Str, quit_parsing_flags=True) # command string
spec.ShortFlag('-i') # interactive
@@ -392,8 +392,13 @@ def BoilMain(main_argv):
def OilMain(argv):
login_shell = False
b = os.path.basename(argv[0])
main_name, _ = os.path.splitext(b)
if main_name.startswith("-"):
login_shell = True
main_name = main_name[1:]
if main_name in ('oil', 'oil_main'):
try:
@@ -410,12 +415,15 @@ def OilMain(argv):
sys.exit(0)
main_name = first_arg
if main_name.startswith("-"):
login_shell = True
main_name = main_name[1:]
main_argv = argv[2:]
else:
main_argv = argv[1:]
if main_name in ('osh', 'sh'):
status = OshMain(main_argv)
status = OshMain(main_argv, login_shell)
tlog('done osh main')
return status
elif main_name == 'wok':

0 comments on commit bee2d0f

Please sign in to comment.