--- john.bash_completion.orig 2012-05-28 19:10:42.346567026 +0000 +++ john.bash_completion 2012-06-01 15:07:56.102609967 +0000 @@ -150,6 +150,11 @@ _john() return 0 ;; -?(-)fo?(r|rm|rma|rmat)=*) + if [[ "_${cur#*o}" == "_=" || "_${cur#*o}" == "_r=" ]] ; then + if [[ `echo "${valopts}"|grep -c "^-*${cur%=}"` -ne 1 ]] ; then + return 0 + fi + fi cur=${cur#*=} formats=`${first} |sed -n '/^--format/,$ { s#^--format=[ A-Za-z]*:##; /^--/ b; s#^ *##; s#\#dynamic#; s#[/ ]#\n#g; p }'` COMPREPLY=( $(compgen -W "${formats}" -- ${cur}) ) @@ -171,7 +176,12 @@ _john() fi return 0 ;; - -?(-)res?(t|to|tor|tore)=*|-?(-)sta?(t|tu|tus)=*) + -?(-)re?(s|st|sto|stor|store)=*|-?(-)sta?(t|tu|tus)=*) + if [[ "_${cur}" == "_-re=" || "_${cur}" == "_--re=" ]] ; then + if [[ `echo "${valopts}"|grep -c "^--re"` -ne 1 ]] ; then + return 0 + fi + fi # If there is no .rec file in the current directory, the old completion logic will show all files: ##echo _`for f in *.rec; do echo ${f%.rec};done`_ cur=${cur#*=} @@ -451,9 +461,6 @@ _john() fi return 0 ;; - --session=*|--mem-file-size=*|--field-separator-char=*|--fix-state-delay=*|--max-run-time=*|--mkpc=*) - return 0 - ;; -?(-)pla?(t|tf|tfo|tfor|tform)=+(L|l)*|-?(-)dev?(i|ic|ice)=+(L|l)*) # CUDA doesn't allow --device=LIST # workaround: check if --platform= is allowed @@ -491,6 +498,9 @@ _john() fi return 0 ;; + -*=) + return 0; + ;; -*) compreplya=`compgen -W "${options} ${hidden}" -- ${cur}` if [[ "_${compreplya}_" == "__" ]] ; then