mirror of https://github.com/cheat/cheat.git
Added Python 3 support.
This commit is contained in:
parent
e6d5d9b8dc
commit
5e4186f426
10
cheat
10
cheat
|
@ -62,11 +62,11 @@ def main():
|
||||||
|
|
||||||
# print help if requested
|
# print help if requested
|
||||||
if keyphrase.lower() in ['', 'cheat', 'help', '-h', '-help', '--help']:
|
if keyphrase.lower() in ['', 'cheat', 'help', '-h', '-help', '--help']:
|
||||||
print "Usage: cheat [keyphrase]\n"
|
print ("Usage: cheat [keyphrase]\n")
|
||||||
print "Available keyphrases:"
|
print ("Available keyphrases:")
|
||||||
max_command = max([len(x) for x in cheatsheets.keys()]) + 3
|
max_command = max([len(x) for x in cheatsheets.keys()]) + 3
|
||||||
print '\n'.join(sorted(['%s [%s]' % (key.ljust(max_command), value)
|
print ('\n'.join(sorted(['%s [%s]' % (key.ljust(max_command), value)
|
||||||
for key, value in cheatsheets.items()]))
|
for key, value in cheatsheets.items()])))
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
# print the cheatsheet if it exists
|
# print the cheatsheet if it exists
|
||||||
|
@ -81,7 +81,7 @@ def main():
|
||||||
|
|
||||||
# if it does not, say so
|
# if it does not, say so
|
||||||
else:
|
else:
|
||||||
print 'No cheatsheet found for %s.' % keyphrase
|
print ('No cheatsheet found for %s.' % keyphrase)
|
||||||
|
|
||||||
|
|
||||||
def pretty_print(filename):
|
def pretty_print(filename):
|
||||||
|
|
Loading…
Reference in New Issue