From 201cd1d6295d1dc5b8999d92e499f6484a4ec895 Mon Sep 17 00:00:00 2001 From: James Zhu Date: Mon, 21 Oct 2019 15:18:47 +0800 Subject: [PATCH] integrate with bash complete for autocompletion --- scripts/cheat-autocompletion.bash | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 scripts/cheat-autocompletion.bash diff --git a/scripts/cheat-autocompletion.bash b/scripts/cheat-autocompletion.bash new file mode 100755 index 0000000..4d340d1 --- /dev/null +++ b/scripts/cheat-autocompletion.bash @@ -0,0 +1,6 @@ +function _cheat_autocomplete { + wdlist='cheat -l|awk "{print $1}"' + COMPREPLY=(`compgen -W "$wdlist"`) +} + +complete -F _cheat_autocomplete cheat