From 963496db86d2f15a0be6799ee40f8e55607f602f Mon Sep 17 00:00:00 2001 From: Chris Lane Date: Thu, 19 Sep 2013 19:05:22 -0400 Subject: [PATCH] Restored -d functionality to original During the last commit, the -d functionality was changed (likely unintentionally) such that it outputted a raw Python list rather than lines printed to stdout. I've restored the original functionality, because the autocompletion scripts rely upon it. --- cheat | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cheat b/cheat index d234190..de2d63b 100755 --- a/cheat +++ b/cheat @@ -137,11 +137,10 @@ class CheatSheets(object): for key, value in self.sheets.items()]))) # Custom action for argparse - class ListDirectories(argparse.Action): """List cheat directories and exit""" def __call__(self, parser, namespace, values, option_string=None): - print sheets.dirs + print("\n".join(sheets.dirs)) parser.exit() class ListCheatsheets(argparse.Action): @@ -150,7 +149,6 @@ class ListCheatsheets(argparse.Action): print sheets.list() parser.exit() - class EditSheet(argparse.Action): """If the user wants to edit a cheatsheet""" def __call__(self, parser, namespace, values, option_string=None): @@ -159,7 +157,6 @@ class EditSheet(argparse.Action): def main(): - # @todo: refactor out this global global sheets sheets = CheatSheets()