mirror of
https://github.com/cheat/cheat.git
synced 2024-11-25 23:41:36 +01:00
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:
parent
da2b0a872d
commit
963496db86
5
cheat
5
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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user