(subparsers)
return parser
HAR converter: parse command line options and run commands.
HAR converter: parse command line options and run commands.
HAR converter : parse command line options and run commands .
def init_har2case_parser(subparsers):
    """ HAR converter: parse command line options and run commands.
    """
    parser = subparsers.add_parser(
        "har2case",
        help="Convert HAR(HTTP Archive) to YAML/JSON testcases for HttpRunner.",
    )
    parser.add_argument("har_source_file", nargs="?", help="Specify HAR source file")
    parser.add_argument(
        "-2y",
        "--to-yml",
        "--to-yaml",
        dest="to_yaml",
        action="store_true",
        help="Convert to YAML format, if not specified, convert to pytest format by default.",
    )
    parser.add_argument(
        "-2j",
        "--to-json",
        dest="to_json",
        action="store_true",
        help="Convert to JSON format, if not specified, convert to pytest format by default.",
    )
    parser.add_argument(
        "--filter",
        help="Specify filter keyword, only url include filter string will be converted.",
    )
    parser.add_argument(
        "--exclude",
        help="Specify exclude keyword, url that includes exclude string will be ignored, "
        "multiple keywords can be joined with '|'",
    )

    return parser
def init_har2case_parser ( subparsers ) : parser = subparsers . add_parser ( "har2case" , help = "Convert HAR(HTTP Archive) to YAML/JSON testcases for HttpRunner." , ) parser . add_argument ( "har_source_file" , nargs = "?" , help = "Specify HAR source file" ) parser . add_argument ( "-2y" , "--to-yml" , "--to-yaml" , dest = "to_yaml" , action = "store_true" , help = "Convert to YAML format, if not specified, convert to pytest format by default." , ) parser . add_argument ( "-2j" , "--to-json" , dest = "to_json" , action = "store_true" , help = "Convert to JSON format, if not specified, convert to pytest format by default." , ) parser . add_argument ( "--filter" , help = "Specify filter keyword, only url include filter string will be converted." , ) parser . add_argument ( "--exclude" , help = "Specify exclude keyword, url that includes exclude string will be ignored, " "multiple keywords can be joined with '|'" , ) return parser