From b6e73539bd6e66eed396699b378538ab640154b2 Mon Sep 17 00:00:00 2001 From: 0rax Date: Fri, 11 Oct 2013 16:26:24 +0200 Subject: [PATCH] Added autocompletion for fish shell --- autocompletion/cheat.fish | 9 +++++++++ setup.py | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 autocompletion/cheat.fish diff --git a/autocompletion/cheat.fish b/autocompletion/cheat.fish new file mode 100644 index 0000000..5dc1c70 --- /dev/null +++ b/autocompletion/cheat.fish @@ -0,0 +1,9 @@ +#completion for cheat +complete -c cheat -s h -l help -f -x --description "Display help and exit" +complete -c cheat -s e -l edit -f -x --description "Edit " +complete -c cheat -s l -l list -f -x --description "List all available cheatsheets" +complete -c cheat -s d -l cheat-directories -f -x --description "List all current cheat dirs" +complete -c cheat --authoritative -f +for cheatsheet in (cheat -l | cut -d' ' -f1) + complete -c cheat -a "$cheatsheet" +end diff --git a/setup.py b/setup.py index 663abbe..df3fb01 100644 --- a/setup.py +++ b/setup.py @@ -18,5 +18,7 @@ setup(name='cheat', if '.' not in f]}, scripts=['cheat'], data_files=[('/usr/share/zsh/site-functions', ['autocompletion/cheat.zsh']), - ('/etc/bash_completion.d' , ['autocompletion/cheat.bash'])] - ) + ('/etc/bash_completion.d' , ['autocompletion/cheat.bash']), + ('/usr/share/fish/completions' , ['autocompletion/cheat.fish']) + ] + )