From 587dbf3c11488c965baad95bf088a2e99f6ee732 Mon Sep 17 00:00:00 2001 From: Chris Lane Date: Sat, 14 Sep 2013 10:27:53 -0400 Subject: [PATCH] Integrated the autocompletion scripts into the project, and rewrote the bash version to take advantage of the new -l option. --- cheat-completion.bash => autocompletion/cheat.bash | 7 +------ _cheat => autocompletion/cheat.zsh | 0 setup.py | 12 ++++++------ 3 files changed, 7 insertions(+), 12 deletions(-) rename cheat-completion.bash => autocompletion/cheat.bash (56%) rename _cheat => autocompletion/cheat.zsh (100%) diff --git a/cheat-completion.bash b/autocompletion/cheat.bash similarity index 56% rename from cheat-completion.bash rename to autocompletion/cheat.bash index eef3ac2..dbb05e6 100644 --- a/cheat-completion.bash +++ b/autocompletion/cheat.bash @@ -1,10 +1,5 @@ -# -# Autocomplete for cheat.py -# Copyright (c) 2013, Jean-Philippee "Orax" Roemer -# - function _cheat_autocomplete { - sheets=$(cheat | tail -n +17 | cut -d' ' -f1) + sheets=$(cheat -l | cut -d' ' -f1) COMPREPLY=() if [ $COMP_CWORD = 1 ]; then COMPREPLY=(`compgen -W "$sheets" -- $2`) diff --git a/_cheat b/autocompletion/cheat.zsh similarity index 100% rename from _cheat rename to autocompletion/cheat.zsh diff --git a/setup.py b/setup.py index 5d7ffe5..663abbe 100644 --- a/setup.py +++ b/setup.py @@ -5,18 +5,18 @@ import os setup(name='cheat', version='1.0', - summary='Create and view interactive cheatsheets on the command-line', - homepage='', author='Chris Lane', author_email='chris@chris-allen-lane.com', license='GPL3', - description='', - platform='Posix', + description='cheat allows you to create and view interactive cheatsheets\ + on the command-line. It was designed to help remind *nix system\ + administrators of options for commands that they use frequently, but not\ + frequently enough to remember.', url='https://github.com/chrisallenlane/cheat', packages=['cheatsheets'], package_data={'cheatsheets': [f for f in os.listdir('cheatsheets') if '.' not in f]}, scripts=['cheat'], - data_files=[('/usr/share/zsh/site-functions', ['_cheat']), - ('/etc/bash_completion.d', ['cheat-completion.bash'])] + data_files=[('/usr/share/zsh/site-functions', ['autocompletion/cheat.zsh']), + ('/etc/bash_completion.d' , ['autocompletion/cheat.bash'])] )