Skip to content

Commit

Permalink
feat(build-cli): Add autocomplete support for bash and zsh (#12748)
Browse files Browse the repository at this point in the history
Adds an `autocomplete` command to flub which can be used to generate
autocomplete config for bash and zsh. This is provided "for free" by
using
[@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete).

fish is not supported, but possibly could be with this PR:
oclif/plugin-autocomplete#38 We could either
wait for the feature to come, release a custom plugin with that PR in
the meantime, or open our own PR to add it.
  • Loading branch information
tylerbutler committed Nov 2, 2022
1 parent b34ebd9 commit 429840d
Show file tree
Hide file tree
Showing 6 changed files with 193 additions and 0 deletions.
123 changes: 123 additions & 0 deletions build-tools/lerna-package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build-tools/packages/build-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ USAGE
<!-- commands -->
# Command Topics

* [`flub autocomplete`](docs/autocomplete.md) - display autocomplete installation instructions
* [`flub bump`](docs/bump.md) - Bump the version of packages, release groups, and their dependencies.
* [`flub check`](docs/check.md) - Check commands are used to verify repo state, apply policy, etc.
* [`flub commands`](docs/commands.md) - list all the commands
Expand Down
35 changes: 35 additions & 0 deletions build-tools/packages/build-cli/docs/autocomplete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
`flub autocomplete`
===================

display autocomplete installation instructions

* [`flub autocomplete [SHELL]`](#flub-autocomplete-shell)

## `flub autocomplete [SHELL]`

display autocomplete installation instructions

```
USAGE
$ flub autocomplete [SHELL] [-r]
ARGUMENTS
SHELL shell type
FLAGS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
DESCRIPTION
display autocomplete installation instructions
EXAMPLES
$ flub autocomplete
$ flub autocomplete bash
$ flub autocomplete zsh
$ flub autocomplete --refresh-cache
```

_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.3.5/src/commands/autocomplete/index.ts)_
2 changes: 2 additions & 0 deletions build-tools/packages/build-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"@fluidframework/build-tools": "^0.5.0",
"@fluidframework/bundle-size-tools": "^0.5.0",
"@oclif/core": "^1.9.5",
"@oclif/plugin-autocomplete": "^1.3.5",
"@oclif/plugin-commands": "^2.2.0",
"@oclif/plugin-help": "^5",
"@oclif/plugin-not-found": "^2.3.1",
Expand Down Expand Up @@ -149,6 +150,7 @@
"-V"
],
"plugins": [
"@oclif/plugin-autocomplete",
"@oclif/plugin-commands",
"@oclif/plugin-help",
"@oclif/plugin-not-found"
Expand Down
30 changes: 30 additions & 0 deletions build-tools/packages/version-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,40 @@ USAGE
# Commands

<!-- commands -->
* [`fluv autocomplete [SHELL]`](#fluv-autocomplete-shell)
* [`fluv help [COMMAND]`](#fluv-help-command)
* [`fluv version VERSION`](#fluv-version-version)
* [`fluv version latest`](#fluv-version-latest)

## `fluv autocomplete [SHELL]`

display autocomplete installation instructions

```
USAGE
$ fluv autocomplete [SHELL] [-r]
ARGUMENTS
SHELL shell type
FLAGS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
DESCRIPTION
display autocomplete installation instructions
EXAMPLES
$ fluv autocomplete
$ fluv autocomplete bash
$ fluv autocomplete zsh
$ fluv autocomplete --refresh-cache
```

_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.3.5/src/commands/autocomplete/index.ts)_

## `fluv help [COMMAND]`

Display help for fluv.
Expand Down
2 changes: 2 additions & 0 deletions build-tools/packages/version-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
},
"dependencies": {
"@oclif/core": "^1.9.5",
"@oclif/plugin-autocomplete": "^1.3.5",
"@oclif/plugin-commands": "^2.2.0",
"@oclif/plugin-help": "^5",
"@oclif/plugin-not-found": "^2.3.1",
Expand Down Expand Up @@ -118,6 +119,7 @@
"-V"
],
"plugins": [
"@oclif/plugin-autocomplete",
"@oclif/plugin-help"
],
"repositoryPrefix": "<%- repo %>/blob/main/build-tools/packages/version-tools/<%- commandPath %>",
Expand Down

0 comments on commit 429840d

Please sign in to comment.