fix(cli): make 'build --help' actually print help
test / run tests/run_tests.py (push) Successful in 15s
test / run tests/run_tests.py (push) Successful in 15s
cmd_build was ignoring its argv, so 'cli.py build --help' fell through and started a docker build instead of printing the subcommand's argparse help. Wire up an empty parser so --help and unknown args are handled the same way the other subcommands handle them. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -2,13 +2,17 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from .. import docker as docker_mod
|
from .. import docker as docker_mod
|
||||||
from ._common import REPO_DIR
|
from ._common import PROG, REPO_DIR
|
||||||
|
|
||||||
|
|
||||||
def cmd_build(_argv: list[str]) -> int:
|
def cmd_build(argv: list[str]) -> int:
|
||||||
|
parser = argparse.ArgumentParser(prog=f"{PROG} build", add_help=True)
|
||||||
|
parser.parse_args(argv)
|
||||||
|
|
||||||
docker_mod.require_docker()
|
docker_mod.require_docker()
|
||||||
image = os.environ.get("CLAUDE_BOTTLE_IMAGE", "claude-bottle:latest")
|
image = os.environ.get("CLAUDE_BOTTLE_IMAGE", "claude-bottle:latest")
|
||||||
docker_mod.build_image(image, REPO_DIR)
|
docker_mod.build_image(image, REPO_DIR)
|
||||||
|
|||||||
Reference in New Issue
Block a user