From 64f7321919531b3f03452ea48897a90cb65d10ae Mon Sep 17 00:00:00 2001 From: Joseph Yu Date: Mon, 20 Aug 2018 17:11:05 +0100 Subject: [PATCH] Shell based completion path selection --- install.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/install.py b/install.py index 393952679..c24331b3e 100644 --- a/install.py +++ b/install.py @@ -166,6 +166,15 @@ def copy_completion_scripts(dest_dir): print dest_bin_dir if completion_path: - print "You may also want to source the relevant completion script from:" + print + print "You may also want to source the", + + shell = os.getenv('SHELL') + if shell: + ext = "csh" if "csh" in shell else "sh" # Basic selection logic + print "completion script (for {0}):".format(shell) + print "source {0}/complete.{1}".format(completion_path, ext) + else: + print "relevant completion script from:" print completion_path print