Skip to content

Commit

Permalink
Commands might be now provided as arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Mar 22, 2019
1 parent 0fd6c0b commit b5a86bd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CurseBreaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ def start(self):
self.handle_exception(e)
os.system('timeout /t 5')
sys.exit(0)
# CLI command
if len(sys.argv) >= 2:
command = ' '.join(sys.argv[1:]).split(' ', 1)
if getattr(self, f'c_{command[0].lower()}', False):
try:
getattr(self, f'c_{command[0].lower()}')(command[1].strip() if len(command) > 1 else False)
except Exception as e:
self.handle_exception(e)
else:
printft('Command not found.')
sys.exit(0)
# Addons auto update
if len(self.core.config['Addons']) > 0:
printft('Automatic update of all addons will start in 5 seconds.\n'
Expand Down

0 comments on commit b5a86bd

Please sign in to comment.