def main(argv):
parser = build_cli_parser()
opts, args = parser.parse_args(argv)
if not opts.url or not opts.token:
print "Missing required param; run with --help for usage"
sys.exit(-1)
# build a cbapi object
#
cb = cbapi.CbApi(opts.url, token=opts.token, ssl_verify=opts.ssl_verify)
# enumerate all watchlists
#
watchlists = cb.watchlist()
print "%-4s | %-32s | %s" % ('id', 'name', 'query')
print "%-4s + %-32s + %s" % ('-' * 4, '-' * 32, '-' * 60)
# for each result
for watchlist in watchlists:
print "%-4s | %-32s | %s" % (watchlist['id'], watchlist['name'], truncate(opts.fulloutput, watchlist['search_query'], 57))
评论列表
文章目录