mirror of
https://github.com/Erreur32/cheat.git
synced 2024-10-31 21:11:07 +01:00
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 ]))
|
||||
return cheats
|
||||
|
||||
def main():
|
||||
"""MAIN"""
|
||||
|
||||
# assemble a keyphrase out of all params passed to the script
|
||||
keyphrase = ' '.join(sys.argv[1:])
|
||||
cheat_dirs = cheat_directories()
|
||||
@ -50,3 +53,6 @@ if keyphrase in cheatsheets:
|
||||
# if it does not, say so
|
||||
else:
|
||||
print 'No cheatsheet found for %s.' % keyphrase
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
Loading…
Reference in New Issue
Block a user