Commit 852b9bd1e7b293828a757b6b997050e0e67ba76f
1 parent
6fd2df27
Exists in
dev
add parse_arg function to agent
Showing
1 changed file
with
8 additions
and
0 deletions
Show diff stats
src/core/pyros_django/agent/Agent.py
... | ... | @@ -3471,6 +3471,14 @@ class Agent: |
3471 | 3471 | """ |
3472 | 3472 | |
3473 | 3473 | import argparse |
3474 | + | |
3475 | +def parse_args(args): | |
3476 | + parser = argparse.ArgumentParser(description='Start an agent.') | |
3477 | + parser.add_argument("--computer",dest="computer",help='Launch agent with simulated computer hostname',action="store") | |
3478 | + parser.add_argument("-t", action="store_true") | |
3479 | + args = vars(parser.parse_args(args)) | |
3480 | + return args | |
3481 | + | |
3474 | 3482 | def __extract_parameters(): |
3475 | 3483 | """ Usage: Agent.py [-t] [configfile] """ |
3476 | 3484 | # arg 1 : -t | ... | ... |