mirror of https://github.com/cheat/cheat.git
Change indent level from 2 spaces to 4.
This commit is contained in:
parent
f10c7fd19b
commit
b38bbceb8a
16
cheat
16
cheat
|
@ -25,20 +25,20 @@ keyphrase = ' '.join(sys.argv[1:])
|
||||||
|
|
||||||
# print help if requested
|
# print help if requested
|
||||||
if keyphrase in ['', 'help', '--help', '-h']:
|
if keyphrase in ['', 'help', '--help', '-h']:
|
||||||
print "Usage: cheat [keyphrase]\n"
|
print "Usage: cheat [keyphrase]\n"
|
||||||
print "Available keyphrases:"
|
print "Available keyphrases:"
|
||||||
print "\n".join([name[0] for name in cheatsheets])
|
print "\n".join([name[0] for name in cheatsheets])
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
sheet_found = False
|
sheet_found = False
|
||||||
# print the cheatsheet if it exists
|
# print the cheatsheet if it exists
|
||||||
for sheet in cheatsheets:
|
for sheet in cheatsheets:
|
||||||
if keyphrase == sheet[0]:
|
if keyphrase == sheet[0]:
|
||||||
cheatsheet_filename = os.path.join(sheet[1], keyphrase)
|
cheatsheet_filename = os.path.join(sheet[1], keyphrase)
|
||||||
with open(cheatsheet_filename, 'r') as cheatsheet:
|
with open(cheatsheet_filename, 'r') as cheatsheet:
|
||||||
print cheatsheet.read()
|
print cheatsheet.read()
|
||||||
sheet_found = True
|
sheet_found = True
|
||||||
|
|
||||||
# if it does not, say so
|
# if it does not, say so
|
||||||
if not sheet_found:
|
if not sheet_found:
|
||||||
print 'No cheatsheet found.'
|
print 'No cheatsheet found.'
|
||||||
|
|
Loading…
Reference in New Issue