-
Notifications
You must be signed in to change notification settings - Fork 20
Document multiple sources in listen command #303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,11 +103,15 @@ func newListenCmd() *listenCmd { | |
| lc := &listenCmd{} | ||
|
|
||
| lc.cmd = &cobra.Command{ | ||
| Use: "listen [port or forwarding URL] [source] [connection]", | ||
| Short: "Forward events for a source to your local server", | ||
| Long: `Forward events for a source to your local server. | ||
| Use: "listen [port or forwarding URL] [source(s)] [connection]", | ||
| Short: "Forward events for one or more sources to your local server", | ||
| Long: `Forward events for one or more sources to your local server. | ||
|
|
||
| This command will create a new Hookdeck Source if it doesn't exist. | ||
| You can listen to a single source, a comma-separated list of sources, or | ||
| "*" to listen to all of your sources at once. | ||
|
|
||
| This command will create a new Hookdeck Source if it doesn't exist (single | ||
| source only). | ||
|
|
||
| By default the Hookdeck Destination will be named "{source}-cli", and the | ||
| Destination CLI path will be "/". To set the CLI path, use the "--path" flag.`, | ||
|
|
@@ -178,12 +182,12 @@ Destination CLI path will be "/". To set the CLI path, use the "--path" flag.`, | |
| usage = strings.Replace( | ||
| usage, | ||
| "{{.UseLine}}", | ||
| `hookdeck listen [port or forwarding URL] [source] [connection] [flags] | ||
| `hookdeck listen [port or forwarding URL] [source(s)] [connection] [flags] | ||
|
|
||
| Arguments: | ||
|
|
||
| - [port or forwarding URL]: Required. The port or forwarding URL to forward the events to e.g., "3000" or "http://localhost:3000" | ||
| - [source]: Required. The name of source to forward the events from e.g., "shopify", "stripe" | ||
| - [source(s)]: Optional. One source name, a comma-separated list of source names (e.g. "shopify,stripe"), or "*" to listen to all sources. If omitted, the CLI prompts you to choose. | ||
| - [connection]: Optional. The name of the connection linking the Source and the Destination | ||
| `, 1) | ||
|
|
||
|
|
@@ -195,6 +199,14 @@ Examples: | |
|
|
||
| hookdeck listen %[1]d shopify | ||
|
|
||
| Forward events from multiple sources to a local server running on port %[1]d: | ||
|
|
||
| hookdeck listen %[1]d shopify,stripe | ||
|
|
||
| Forward events from all of your sources: | ||
|
|
||
| hookdeck listen %[1]d '*' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same, broken port.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above — Generated by Claude Code |
||
|
|
||
| Forward events to a local server running on "http://myapp.test:%[1]d": | ||
|
|
||
| hookdeck listen http://myapp.test:%[1]d | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The port in the example seems broken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%[1]dhere is a Gofmt.Sprintfverb, not a literal — the whole Examples block is built viafmt.Sprintf(..., 3000), so this renders ashookdeck listen 3000 shopify,stripe. It matches the pre-existing examples in the same block (e.g.hookdeck listen %[1]d shopifya few lines up), which also use%[1]d. GitHub only let you comment on the newly-added lines, so the identical older lines aren't flagged. Happy to switch the entire block to a literal3000if you'd prefer that for readability, but I left these consistent with the surrounding examples.Generated by Claude Code