Date: Tue, 3 Jul 2012 13:56:04 +0200 From: Frank Dittrich <frank_dittrich@...mail.com> To: john-dev@...ts.openwall.com Subject: Bash completion: add support for --list=format-methods[:WHICH] This was intended for bleeding, but the patched bash completion script should work well with formats which don't have this new option. Now that the --list=format-methods[:WHICH] is implemented in magnum-jumbo, this patch should be applied to magnum-jumbo as well. Otherwise, $ ./john --list=format-m would get completed to $ ./john --list=format-methods[:WHICH] The new script will use only the substrings up to '[' or ':' (whichever comes first) for completion. Currently, for expansion of method names I use the hard coded obtained from bleeding using $ ./john --list=format-methods|sed -n '/^\s/ s#^\s*\([^(\*\).*$#\1# p'|sort -u I didn't want to do that every time someone wants to complete a method name, that's why a hard coded list. Side effect for jumbo: $ ./john --list=format-methods:get_[tab][tab] get_hash get_key get_source But, of course, get_source is invalid for magnum-jumbo. $ ./john --list=format-methods:get_source Error, invalid option (invalid method name) format-methods:get_source I consider the hard coded list a q&d workaround. Should a new --list=method-names be implemented, or should I rather use ./john --list=format-methods|sed -n '/^\s/ s#^\s*\([^(\*\).*$#\1# p'|sort -u in my script. I tested it, the run time is not too bad. Still, the new bash completion script is better than the old one even for jumbo. Frank View attachment "0001-Bash-completion-add-support-for-list-format-methods-.patch" of type "text/x-patch" (3203 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.