From 16361439c44191ce94d2694552f677b9d2c76124 Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Mon, 1 Jun 2015 18:14:21 +0200 Subject: http2: add command line arguments --- libpathod/cmdline.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'libpathod/cmdline.py') diff --git a/libpathod/cmdline.py b/libpathod/cmdline.py index 22205fb7..06a6c533 100644 --- a/libpathod/cmdline.py +++ b/libpathod/cmdline.py @@ -65,6 +65,17 @@ def args_pathoc(argv, stdout=sys.stdout, stderr=sys.stderr): "-t", dest="timeout", type=int, default=None, help="Connection timeout" ) + parser.add_argument( + "--http2", dest="use_http2", action="store_true", default=False, + help='Perform all requests over a single HTTP/2 connection.' + ) + parser.add_argument( + "--http2-skip-connection-preface", + dest="http2_skip_connection_preface", + action="store_true", + default=False, + help='Skips the HTTP/2 connection preface before sending requests.') + parser.add_argument( 'host', type=str, metavar = "host[:port]", @@ -77,6 +88,7 @@ def args_pathoc(argv, stdout=sys.stdout, stderr=sys.stderr): specifcations """ ) + group = parser.add_argument_group( 'SSL', ) @@ -189,7 +201,7 @@ def args_pathoc(argv, stdout=sys.stdout, stderr=sys.stderr): data = open(r).read() r = data try: - reqs.append(language.parse_pathoc(r)) + reqs.append(language.parse_pathoc(r, args.use_http2)) except language.ParseException as v: print >> stderr, "Error parsing request spec: %s" % v.msg print >> stderr, v.marked() -- cgit v1.2.3