mirror of https://github.com/cheat/cheat.git
Added main function and wrapped everything in it.
This commit is contained in:
parent
84f3105139
commit
01b35ab0b7
6
cheat
6
cheat
|
@ -19,6 +19,9 @@ def cheat_files(cheat_directories):
|
||||||
for cheat in os.listdir(cheat_dir) if '.' not in cheat ]))
|
for cheat in os.listdir(cheat_dir) if '.' not in cheat ]))
|
||||||
return cheats
|
return cheats
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""MAIN"""
|
||||||
|
|
||||||
# assemble a keyphrase out of all params passed to the script
|
# assemble a keyphrase out of all params passed to the script
|
||||||
keyphrase = ' '.join(sys.argv[1:])
|
keyphrase = ' '.join(sys.argv[1:])
|
||||||
cheat_dirs = cheat_directories()
|
cheat_dirs = cheat_directories()
|
||||||
|
@ -50,3 +53,6 @@ if keyphrase in cheatsheets:
|
||||||
# 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
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|
Loading…
Reference in New Issue