From d03638cff10636995c5c29a4120f031fbc77fc6c Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Fri, 14 Mar 2014 22:54:16 +0100 Subject: completion: [['s regex needs explicit start boundary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (haven't expected that, oops) Signed-off-by: Jan Pokorný --- completion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'completion.py') diff --git a/completion.py b/completion.py index 7e61602..5a39aba 100644 --- a/completion.py +++ b/completion.py @@ -116,14 +116,14 @@ local cur fnc i=${{COMP_CWORD}} while true; do test ${{i}} -eq 0 && break || let i-=1 cur=${{COMP_WORDS[${{i}}]}} - [[ "${{cur}}" =~ -.* ]] && continue + [[ "${{cur}}" =~ ^-.* ]] && continue # handle aliases case ${{cur}} in {5} esac fnc=_{0}_${{cur/-/_}} declare -f ${{fnc}} >/dev/null && COMPREPLY+=( $(${{fnc}} $2) ) - [[ "$2" =~ -.* ]] \ + [[ "$2" =~ ^-.* ]] \ && COMPREPLY+=( $(compgen -W "${{opts_common}} ${{opts_nonmain}}" -- $2) ) return done -- cgit