-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathant.py
35 lines (25 loc) · 803 Bytes
/
ant.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from lib import core
from config import profile
import argparse
'''Ant - An Interpreter'''
def main():
shell = core.Shell(alias=profile['aliases'])
shell.start()
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--version', action='version',
version=f'{core.__version__}')
parser.add_argument('-c', '--command', help='Run a command')
parser.add_argument('-s', '--script', help='Run a script')
args = parser.parse_args()
if args.command:
try:
_shell = core.Shell()
_shell.execute(args.command)
except Exception as e:
print(e)
elif args.script:
_shell = core.Shell()
_shell.script_executer(args.script)
else:
main()