You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -203,6 +204,7 @@ command and subcommands (under the `commands` definition).
203
204
`help` | The header text to display when using `--help`. This option can have multiple lines. In this case, the first line will be used as summary wherever appropriate.
204
205
`version` | The string to display when using `--version`. *Applicable only in the main command*.
205
206
`default` | Setting this to `true` on any command, will cause any unrecognized command line to be passed to this command. *Applicable only in subcommands*.
207
+
`extensible` | Specify that this command can be [externally extended](#extensible-commands).
206
208
`examples` | Specify an array of examples to show when using `--help`. Each example can have multiple lines.
207
209
`environment_variables` | Specify an array of [environment variables](#environment-variable-options) needed by your script.
208
210
`commands` | Specify the array of [commands](#command-options). Each command will have its own args and flags. Note: if `commands` is provided, you cannot specify flags or args at the same level.
@@ -262,6 +264,82 @@ set.
262
264
`required` | Specify if this variable is required.
263
265
264
266
267
+
## Extensible Commands
268
+
269
+
You may configure your generated bash script to delegate any unknown command
270
+
to an external executable, by setting the `extensible` option to either `true`,
271
+
or to a different external command.
272
+
273
+
This is similar to how `git` works. When you execute `git whatever`, the `git`
274
+
command will look for a file named `git-whatever` in the path, and execute it.
275
+
276
+
Note that this option cannot be specified together with the `default` option,
277
+
since both specify a handler for unknown commands.
278
+
279
+
Bashly supports two operation modes.
280
+
281
+
### Extension Mode (`extensible: true`)
282
+
283
+
By setting `extensible` to `true`, a specially named executable will be called
284
+
when an unknown command is called by the user.
285
+
286
+
Given this `bashly.yml` configuration:
287
+
288
+
```yaml
289
+
name: myscript
290
+
help: Example
291
+
version: 0.1.0
292
+
extensible: true
293
+
294
+
commands:
295
+
- name: upload
296
+
help: Upload a file
297
+
```
298
+
299
+
And this user command:
300
+
301
+
```
302
+
$ myscript something
303
+
304
+
```
305
+
306
+
The generated script will look for an executable named `myscript-something`
0 commit comments