Adds fzf completion to hashcat hash modes in completion script

This commit is contained in:
Jonathan Hodgson 2020-05-06 16:45:38 +01:00
parent 649dd023b9
commit be7e151903

View file

@ -23,7 +23,13 @@ _args(){
} }
_hashes(){ _hashes(){
hashcat --example-hashes | awk -v RS="\n\n" -F "\t" '{gsub("\n","\t",$0); print $1 ":" $2 }' | sed 's/MODE: //; s/TYPE: //' if $(type fzf > /dev/null); then
# If fzf if available, use it for hash completion
hashcat --example-hashes | awk -v RS="\n\n" -F "\t" '{gsub("\n","\t",$0); print $1 "\t" $2 "\t" $3}' | sed 's/MODE: //; s/TYPE: //' | fzf -d "\t" --header="Mode Type" --with-nth='1,2' --preview='echo {3}' --preview-window=up:1 | cut -d' ' -f1
else
hashcat --example-hashes | awk -v RS="\n\n" -F "\t" '{gsub("\n","\t",$0); print $1 ":" $2 }' | sed 's/MODE: //; s/TYPE: //'
fi
} }
_basic_section(){ _basic_section(){