diff options
| author | NotRexed <therealnothingfn@gmail.com> | 2026-11-28 15:14:52 -0500 |
|---|---|---|
| committer | NotRexed <therealnothingfn@gmail.com> | 2026-11-28 15:14:52 -0500 |
| commit | 127ffbfa3bd88dfaf77f03daab7c5c32bfacdb60 (patch) | |
| tree | 77aa12cb0644f382f922d652f954a5dc5a3af4a2 /scripts/dev.py | |
| parent | 95ac2e96aa6976d9095151a71aefeace6335c565 (diff) | |
| parent | 13ed298fa2d6b4eb9969a9196e4b4f38624e513c (diff) | |
Merge remote-tracking branch 'origin/main' into merge/push-m4
Diffstat (limited to 'scripts/dev.py')
| -rw-r--r-- | scripts/dev.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/dev.py b/scripts/dev.py index 4170aac63..00bf1bb21 100644 --- a/scripts/dev.py +++ b/scripts/dev.py | |||
| @@ -90,15 +90,15 @@ def guest_scene(args: list[str]) -> int: | |||
| 90 | parser.add_argument("-h", "--help", action="store_true") | 90 | parser.add_argument("-h", "--help", action="store_true") |
| 91 | parser.add_argument("--out", metavar="PATH") | 91 | parser.add_argument("--out", metavar="PATH") |
| 92 | options, _ = parser.parse_known_args(args) | 92 | options, _ = parser.parse_known_args(args) |
| 93 | if not options.help and not options.out: | 93 | if not options.help and not (options.out and options.out.strip()): |
| 94 | parser.error("--out PATH is required to keep the scene results") | 94 | parser.error("--out PATH is required to keep the scene results") |
| 95 | 95 | ||
| 96 | return run_producer(GUEST_SCENE, args) | 96 | return run_producer(GUEST_SCENE, args) |
| 97 | 97 | ||
| 98 | 98 | ||
| 99 | def main() -> int: | 99 | def main(argv: list[str] | None = None) -> int: |
| 100 | # The producer owns its arguments and help. Forward before argparse handles them. | 100 | # The producer owns its arguments and help. Forward before argparse handles them. |
| 101 | argv = sys.argv[1:] | 101 | argv = sys.argv[1:] if argv is None else list(argv) |
| 102 | if argv[:1] == ["boot-trace"]: | 102 | if argv[:1] == ["boot-trace"]: |
| 103 | return run_producer(BOOT_TRACE, argv[1:]) | 103 | return run_producer(BOOT_TRACE, argv[1:]) |
| 104 | if argv[:1] == ["guest-scene"]: | 104 | if argv[:1] == ["guest-scene"]: |
| @@ -119,7 +119,10 @@ def main() -> int: | |||
| 119 | if args.json: | 119 | if args.json: |
| 120 | print(json.dumps(result, indent=2)) | 120 | print(json.dumps(result, indent=2)) |
| 121 | else: | 121 | else: |
| 122 | sys.stdout.reconfigure(encoding="utf-8") | 122 | try: |
| 123 | sys.stdout.reconfigure(encoding="utf-8") | ||
| 124 | except (AttributeError, ValueError, OSError): | ||
| 125 | pass | ||
| 123 | print("Paths and help commands are relative to the Leonida checkout root.") | 126 | print("Paths and help commands are relative to the Leonida checkout root.") |
| 124 | for tool in result["tools"]: | 127 | for tool in result["tools"]: |
| 125 | status = "present" if tool["present"] else "missing" | 128 | status = "present" if tool["present"] else "missing" |