Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: show errors for custom commands when flags are parsed, fixes #7409#7451

Merged
rfay merged 1 commit into
ddev:mainfrom
stasadev:20250714_stasadev_show_errors_for_parsed_flags
Jul 15, 2025
Merged

fix: show errors for custom commands when flags are parsed, fixes #7409#7451
rfay merged 1 commit into
ddev:mainfrom
stasadev:20250714_stasadev_show_errors_for_parsed_flags

Conversation

@stasadev
Copy link
Copy Markdown
Member

The Issue

Create a .ddev/commands/host/test-example or .ddev/commands/web/test-example (the important part is ## Flags: []):

#!/usr/bin/env bash

## Usage: test-example <input>
## Flags: []
## CanRunGlobally: true

echo $1

And run it:

ddev test-example '- h'

How This PR Solves The Issue

Shows hidden error.

This PR doesn't really fix the described behavior in the issue, but it's not a DDEV problem.

Manual Testing Instructions

Before (shows help only, which is confusing):

$ ddev test-example '- h'
test-example (shell host container command)

Usage:
  ddev test-example <input> [flags]
...

After (shows hidden error and help):

$ ddev test-example '- h'
Error: unknown shorthand flag: ' ' in - h
Usage:
  ddev test-example <input> [flags]
...

Automated Testing Overview

Release/Deployment Notes

@stasadev stasadev requested a review from a team as a code owner July 14, 2025 12:44
@github-actions
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well

Copy link
Copy Markdown
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me!

@rfay rfay merged commit 768d1c9 into ddev:main Jul 15, 2025
24 of 25 checks passed
@rfay rfay deleted the 20250714_stasadev_show_errors_for_parsed_flags branch July 15, 2025 16:34
rfay pushed a commit that referenced this pull request Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants