Document Bash completion setup

This commit is contained in:
2026-11-03 13:12:36 +00:00
parent f79f446726
commit 8964ad02ad
6 changed files with 38 additions and 5 deletions

View File

@@ -15,7 +15,10 @@ if executable is None:
quoted_script = shlex.quote(script)
if shell == "bash":
args = ["--noprofile", "--norc", "-i"]
setup = 'PS1="PROMPT> "; source /usr/share/bash-completion/bash_completion; source ' + quoted_script
bash_init = os.environ.get("COMPLETION_BASH_INIT", "/usr/share/bash-completion/bash_completion")
if not os.path.isfile(bash_init):
raise SystemExit("Set COMPLETION_BASH_INIT to the bash-completion initialization file")
setup = 'PS1="PROMPT> "; source ' + shlex.quote(bash_init) + "; source " + quoted_script
elif shell == "zsh":
args = ["-f"]
setup = 'PROMPT="PROMPT> "; '