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.
This commit is contained in:
Chris Lane 2013-09-19 19:05:22 -04:00
parent da2b0a872d
commit 963496db86

5
cheat
View file

@ -137,11 +137,10 @@ class CheatSheets(object):
for key, value in self.sheets.items()]))) for key, value in self.sheets.items()])))
# Custom action for argparse # Custom action for argparse
class ListDirectories(argparse.Action): class ListDirectories(argparse.Action):
"""List cheat directories and exit""" """List cheat directories and exit"""
def __call__(self, parser, namespace, values, option_string=None): def __call__(self, parser, namespace, values, option_string=None):
print sheets.dirs print("\n".join(sheets.dirs))
parser.exit() parser.exit()
class ListCheatsheets(argparse.Action): class ListCheatsheets(argparse.Action):
@ -150,7 +149,6 @@ class ListCheatsheets(argparse.Action):
print sheets.list() print sheets.list()
parser.exit() parser.exit()
class EditSheet(argparse.Action): class EditSheet(argparse.Action):
"""If the user wants to edit a cheatsheet""" """If the user wants to edit a cheatsheet"""
def __call__(self, parser, namespace, values, option_string=None): def __call__(self, parser, namespace, values, option_string=None):
@ -159,7 +157,6 @@ class EditSheet(argparse.Action):
def main(): def main():
# @todo: refactor out this global
global sheets global sheets
sheets = CheatSheets() sheets = CheatSheets()