>From 7a9d12a5a6461eb19a57f95b44e4ceb273f3b07c Mon Sep 17 00:00:00 2001 From: Frank Dittrich Date: Tue, 19 Jun 2012 19:05:30 +0200 Subject: [PATCH] Bash completion: avoid completion for --l= if --l= is ambiguous Now that --log-stderr exists, john can't parse -l=? anymore --- run/john.bash_completion | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/run/john.bash_completion b/run/john.bash_completion index bfcca17..a086d68 100644 --- a/run/john.bash_completion +++ b/run/john.bash_completion @@ -548,6 +548,12 @@ _john() ;; -?(-)l?(i|is|ist)+(=|:)*) if [[ "${hidden}" == *--list=* || "${valopts}" == *--list=* ]] ; then + #meanwhile, there can be more than one option name starting with l... + if [[ "${cur#*[=:]}" != *i* ]] ; then + if [[ `echo "${valopts}"|grep -c "^-*${cur%[=:]*}"` -ne 1 ]] ; then + return 0 + fi + fi cur=${cur#*[=:]} # the --list=? output changed, that's why a more complex regex is used # to cover all cases -- 1.7.7.6