Skip to content

Commit 535f9e4

Browse files
chore(cli): make --help cmd exit normally without error log (#30)
Remove the false alarm error message in cli. Before: ``` ❯ aenv build --help Usage: aenv build [OPTIONS] Build Docker images with real-time progress display. This command builds Docker images from your project and provides real-time progress updates with beautiful UI components. Examples: aenv build aenv build --image-name myapp --image-tag v1.0 aenv build --work-dir ./myproject --registry myregistry.com Options: -w, --work-dir DIRECTORY Working directory for the build -n, --image-name TEXT Name for the Docker image -t, --image-tag TEXT Tags for the Docker image (can be used multiple times) -r, --registry TEXT Docker registry URL -s, --namespace TEXT Namespace for the Docker image --push / --no-push Push image to registry after build -p, --platform TEXT Platform for the Docker image --help Show this message and exit. ❌ Error: Unexpected error: 0 ``` Currently: ``` ❯ aenv build --help Usage: aenv build [OPTIONS] Build Docker images with real-time progress display. This command builds Docker images from your project and provides real-time progress updates with beautiful UI components. Examples: aenv build aenv build --image-name myapp --image-tag v1.0 aenv build --work-dir ./myproject --registry myregistry.com Options: -w, --work-dir DIRECTORY Working directory for the build -n, --image-name TEXT Name for the Docker image -t, --image-tag TEXT Tags for the Docker image (can be used multiple times) -r, --registry TEXT Docker registry URL -s, --namespace TEXT Namespace for the Docker image --push / --no-push Push image to registry after build -p, --platform TEXT Platform for the Docker image --help Show this message and exit. ```
1 parent 93ff27c commit 535f9e4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

aenv/src/cli/cmds/common.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ def wrapper(*args, **kwargs):
8181
logger.info("Operation interrupted by user")
8282
click.secho("\n⚠️ Operation cancelled", fg="yellow", err=True)
8383
sys.exit(130)
84+
except click.exceptions.Exit:
85+
# Exit exceptions are normal (e.g., --help), let Click handle them
86+
raise
8487
except click.ClickException as e:
8588
_handle_click_error(e)
8689
sys.exit(e.exit_code)

0 commit comments

Comments
 (0)