| 15 | |
| 16 | |
| 17 | def parse_args() -> tuple: |
| 18 | import argparse |
| 19 | |
| 20 | parser = argparse.ArgumentParser(description="Compile wasm") |
| 21 | parser.add_argument( |
| 22 | "sketch_dir", |
| 23 | nargs="?", |
| 24 | default="examples/wasm", |
| 25 | help="The directory of the sketch to compile", |
| 26 | ) |
| 27 | parser.add_argument( |
| 28 | "--run", |
| 29 | action="store_true", |
| 30 | help="Run Playwright tests after compilation (default is compile-only)", |
| 31 | ) |
| 32 | known_args, unknown_args = parser.parse_known_args() |
| 33 | if "--build" in unknown_args: |
| 34 | print("WARNING: --build is no longer supported. It will be ignored.") |
| 35 | unknown_args.remove("--build") |
| 36 | if "-b" in unknown_args: |
| 37 | print("WARNING: -b is no longer supported. It will be ignored.") |
| 38 | unknown_args.remove("-b") |
| 39 | return known_args, unknown_args |
| 40 | |
| 41 | |
| 42 | def main() -> int: |