aboutsummaryrefslogtreecommitdiffstats
path: root/examples/arguments.py
blob: 70851192ce7e9dab4233b857a39f05a743a4fb03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import argparse


class Replacer:
    def __init__(self, src, dst):
        self.src, self.dst = src, dst

    def response(self, flow):
        flow.response.replace(self.src, self.dst)


def start():
    parser = argparse.ArgumentParser()
    parser.add_argument("src", type=str)
    parser.add_argument("dst", type=str)
    args = parser.parse_args()
    return Replacer(args.src, args.dst)