Skip to content

Commit 0da0783

Browse files
committed
docs(listen): clarify multi-source support in help text
The `listen` command already supports listening to multiple sources via a comma-separated list and "*" for all sources, but the `-h` help text only described a single required source, making the feature hard to discover. - Update Short/Long description and Usage line to mention one or more sources - Mark the source argument as optional and document the comma-separated list and "*" syntax - Add multi-source and "*" examples - Regenerate REFERENCE.md
1 parent eeaecc8 commit 0da0783

2 files changed

Lines changed: 25 additions & 9 deletions

File tree

REFERENCE.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,17 +172,21 @@ Pinning project to current directory
172172
<!-- GENERATE:listen:START -->
173173
## Listen
174174
175-
Forward events for a source to your local server.
175+
Forward events for one or more sources to your local server.
176176
177-
This command will create a new Hookdeck Source if it doesn't exist.
177+
You can listen to a single source, a comma-separated list of sources, or
178+
"*" to listen to all of your sources at once.
179+
180+
This command will create a new Hookdeck Source if it doesn't exist (single
181+
source only).
178182
179183
By default the Hookdeck Destination will be named "{source}-cli", and the
180184
Destination CLI path will be "/". To set the CLI path, use the "`--path`" flag.
181185
182186
**Usage:**
183187
184188
```bash
185-
hookdeck listen [port or forwarding URL] [source] [connection] [flags]
189+
hookdeck listen [port or forwarding URL] [source(s)] [connection] [flags]
186190
```
187191
188192
**Arguments:**

pkg/cmd/listen.go

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,15 @@ func newListenCmd() *listenCmd {
103103
lc := &listenCmd{}
104104

105105
lc.cmd = &cobra.Command{
106-
Use: "listen [port or forwarding URL] [source] [connection]",
107-
Short: "Forward events for a source to your local server",
108-
Long: `Forward events for a source to your local server.
106+
Use: "listen [port or forwarding URL] [source(s)] [connection]",
107+
Short: "Forward events for one or more sources to your local server",
108+
Long: `Forward events for one or more sources to your local server.
109109
110-
This command will create a new Hookdeck Source if it doesn't exist.
110+
You can listen to a single source, a comma-separated list of sources, or
111+
"*" to listen to all of your sources at once.
112+
113+
This command will create a new Hookdeck Source if it doesn't exist (single
114+
source only).
111115
112116
By default the Hookdeck Destination will be named "{source}-cli", and the
113117
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.`,
178182
usage = strings.Replace(
179183
usage,
180184
"{{.UseLine}}",
181-
`hookdeck listen [port or forwarding URL] [source] [connection] [flags]
185+
`hookdeck listen [port or forwarding URL] [source(s)] [connection] [flags]
182186
183187
Arguments:
184188
185189
- [port or forwarding URL]: Required. The port or forwarding URL to forward the events to e.g., "3000" or "http://localhost:3000"
186-
- [source]: Required. The name of source to forward the events from e.g., "shopify", "stripe"
190+
- [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.
187191
- [connection]: Optional. The name of the connection linking the Source and the Destination
188192
`, 1)
189193

@@ -195,6 +199,14 @@ Examples:
195199
196200
hookdeck listen %[1]d shopify
197201
202+
Forward events from multiple sources to a local server running on port %[1]d:
203+
204+
hookdeck listen %[1]d shopify,stripe
205+
206+
Forward events from all of your sources:
207+
208+
hookdeck listen %[1]d '*'
209+
198210
Forward events to a local server running on "http://myapp.test:%[1]d":
199211
200212
hookdeck listen http://myapp.test:%[1]d

0 commit comments

Comments
 (0)