diff --git a/bin/cheat b/cheat/app.py similarity index 95% rename from bin/cheat rename to cheat/app.py index 46af2a2..50fddea 100755 --- a/bin/cheat +++ b/cheat/app.py @@ -31,12 +31,13 @@ Options: """ # require the dependencies -from cheat import * -from cheat.utils import * +import sheet +import sheets +from utils import * from docopt import docopt -if __name__ == '__main__': +def main(): # parse the command-line options options = docopt(__doc__, version='cheat 2.1.3') @@ -59,3 +60,6 @@ if __name__ == '__main__': # print the cheatsheet else: print(colorize(sheet.read(options['']))) + +if __name__ == '__main__': + main() diff --git a/setup.py b/setup.py index 26f3f02..91aa692 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,11 @@ setup( package_data = { 'cheat.cheatsheets': ['*'], }, - scripts = ['bin/cheat'], + entry_points = { + 'console_scripts': [ + 'cheat = cheat.app:main', + ], + }, install_requires = [ 'docopt >= 0.6.1', 'pygments >= 1.6.0',