From 0ec77f392127d87bc2dad567c60fbd31f276a161 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 2 Dec 2018 21:53:05 +1300 Subject: Adjust quoting and termination for man completion --- bash/bash_completion.d/man.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bash') diff --git a/bash/bash_completion.d/man.bash b/bash/bash_completion.d/man.bash index 4326c48a..7ee301d6 100644 --- a/bash/bash_completion.d/man.bash +++ b/bash/bash_completion.d/man.bash @@ -20,7 +20,7 @@ _man() { # Read completion results from a subshell and add them to the COMPREPLY # array individually local ci comp - while IFS= read -d '' -r comp ; do + while IFS= read -d / -r comp ; do COMPREPLY[ci++]=$comp done < <( @@ -77,8 +77,8 @@ _man() { # Strip section suffixes pages=("${pages[@]%.[0-9]*}") - # Print entries, null-delimited - printf '%s\0' "${pages[@]}" + # Print quoted entries, slash-delimited + printf '%q/' "${pages[@]}" ) } complete -F _man -o bashdefault -o default man -- cgit v1.2.3