diff options
Diffstat (limited to 'test/scripts')
-rw-r--r-- | test/scripts/a.py | 8 | ||||
-rw-r--r-- | test/scripts/starterr.py | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/test/scripts/a.py b/test/scripts/a.py index 0a21b619..31cdaf0c 100644 --- a/test/scripts/a.py +++ b/test/scripts/a.py @@ -1,5 +1,13 @@ +import argparse + +parser = argparse.ArgumentParser() +parser.add_argument('--var') var = 0 +def __init__(ctx, argv): + global var + var = parser.parse_args(argv).var + def here(ctx): global var var += 1 diff --git a/test/scripts/starterr.py b/test/scripts/starterr.py index 456fecc0..b217bdfe 100644 --- a/test/scripts/starterr.py +++ b/test/scripts/starterr.py @@ -1,3 +1,3 @@ -def start(ctx): +def start(ctx, argv): raise ValueError |