From 14821d424c4f4b5cbc3bfd9ab2a278ed387aa668 Mon Sep 17 00:00:00 2001 From: Chris Lane Date: Sun, 1 Sep 2013 14:41:29 -0400 Subject: [PATCH] Minor modifications on the cheat file. Broke the -d option out into its own logical block. --- cheat | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cheat b/cheat index 04ed89d..6d1bddc 100755 --- a/cheat +++ b/cheat @@ -122,11 +122,7 @@ def main(): # create/edit option option = sys.argv[1].lower() - if option in ['-e', '--edit', '-c', '--create', '-d', '--cheat_directories']: - # list cheat directories and exit - if option in ['-d', '--cheat_directories']: - print(' '.join(cheat_directories())) - exit() + if option in ['-e', '--edit', '-c', '--create']: # make sure EDITOR environment variable is set and that at least 3 arguments # are given if 'EDITOR' not in os.environ: @@ -145,6 +141,11 @@ def main(): elif option in ['-c', '--create']: create_cheatsheet(' '.join(sys.argv[2:]), cheatsheets) + # list cheat directories and exit + if option in ['-d', '--cheat_directories']: + print(' '.join(cheat_directories())) + exit() + # print the cheatsheet if it exists if keyphrase in cheatsheets: filename = os.path.join(cheatsheets[keyphrase], keyphrase)