support list all agents/tracers

Change-Id: I77de64944895031db5fcf4712174b52c41d4c555
This commit is contained in:
Kun Huang 2015-11-03 12:29:03 +08:00
parent c73eb9cb8d
commit 97b8879739
3 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,13 @@
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# Author: Kun Huang <academicgareth@gmail.com>
from scalpels.cli.actions.start import agents_map
from prettytable import PrettyTable
def run(config):
t = PrettyTable(["tracer", "tracer script"])
for ag in agents_map:
t.add_row([ag, agents_map[ag]])
print t

View File

@ -49,6 +49,11 @@ def main():
result.add_argument("--html", action="store_true", dest="html", help="report html to stdout instead of pretty print")
result.add_argument("--short", action="store_true", dest="short", help="report uuid only")
# agent command
agent = subparsers.add_parser("agent")
agent.add_argument("-l", "--list", action="store_true", dest="list", help="list all agents")
parser = rootparser.parse_args()
try:
run(parser)

View File

@ -13,6 +13,7 @@ function debug_msg {
}
function basic_test {
sca agent -l
sca start -a rpc -a rabbit -a traffic
sca load --storm