From f20c0aba20151ec96554ee6dcd2092a9669fc4ba Mon Sep 17 00:00:00 2001 From: a-sk Date: Thu, 29 Aug 2013 19:05:46 +0400 Subject: [PATCH] Add zsh cheats completions --- _cheat | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 _cheat diff --git a/_cheat b/_cheat new file mode 100644 index 0000000..0ebec18 --- /dev/null +++ b/_cheat @@ -0,0 +1,12 @@ +#compdef cheat + +declare -a cheats cheats_in_this_dir + +for directory in $(cheat --cheat_directories); do + cheats_in_this_dir=($directory/*(N:r:t)) + [[ ${#cheats_in_this_dir} > 0 ]] && cheats+=($cheats_in_this_dir) +done + +_arguments "1:cheats:(${cheats})" + +return 1