From 5c51f457a0fdf3c38cfa51bb84661f3fa7349f4f Mon Sep 17 00:00:00 2001 From: a-sk Date: Thu, 29 Aug 2013 18:41:00 +0400 Subject: [PATCH] Add -d/--cheat_directories option to list directories containing cheatsheets --- cheat | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cheat b/cheat index 2abc94a..ffca47d 100755 --- a/cheat +++ b/cheat @@ -121,7 +121,11 @@ def main(): # create/edit option option = sys.argv[1].lower() - if option in ['-e', '--edit', '-c', '--create']: + 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() # make sure EDITOR environment variable is set and that at least 3 arguments # are given if 'EDITOR' not in os.environ: