mirror of
https://github.com/zhigang1992/velociraptor.git
synced 2026-01-12 17:53:16 +08:00
feat(cli): add bash completions support
This commit is contained in:
15
README.md
15
README.md
@@ -384,8 +384,9 @@ to execute the `start` script.
|
||||
|
||||
## Exporting scripts
|
||||
|
||||
You may find yourself in a situation where you want to use velociraptor to manage your scripts during development, but you're not comfortable installing it (or just can't install it) in your production environment.
|
||||
In this case the `export` subcommand may be of help: it allows you to export one or more scripts as standalone executable shell files:
|
||||
If you want to use velociraptor to manage your scripts, but you want to be able to execute them in environments where
|
||||
you can't (or don't want to) install vr, the `export` subcommand may be of help: it allows you to export one or more
|
||||
scripts as standalone executable shell files together with their env variables, Deno cli options etc.:
|
||||
|
||||
```sh
|
||||
$ vr export [SCRIPTS]...
|
||||
@@ -402,7 +403,7 @@ For example, run
|
||||
$ vr export start
|
||||
```
|
||||
|
||||
to export the `start` script, together with its env variables, deno cli options etc. Now you can execute it by running
|
||||
to export the `start` script. Now you can execute it by running
|
||||
|
||||
```sh
|
||||
$ ./bin/start [ARGS]...
|
||||
@@ -422,13 +423,17 @@ Velociraptor searches for script files up the folder tree starting from the dire
|
||||
|
||||
## Shell completions
|
||||
|
||||
To enable zsh tab-completion for velociraptor commands, add the following line to your `~/.zshrc`
|
||||
To enable shell tab-completion for velociraptor commands, add the following line to your `~/.zshrc`
|
||||
|
||||
```sh
|
||||
source <(vr completions zsh)
|
||||
```
|
||||
|
||||
> Bash is not supported yet, but will be added.
|
||||
or `~/.bashrc`
|
||||
|
||||
```sh
|
||||
source <(vr completions bash)
|
||||
```
|
||||
|
||||
## Editor support
|
||||
|
||||
|
||||
1
deps.ts
1
deps.ts
@@ -18,4 +18,5 @@ export { LevelName } from "https://deno.land/std@0.70.0/log/levels.ts";
|
||||
export {
|
||||
Command,
|
||||
StringType,
|
||||
CompletionsCommand,
|
||||
} from "https://deno.land/x/cliffy@v0.14.1/command/mod.ts";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Command } from "../../../deps.ts";
|
||||
import { Command, CompletionsCommand } from "../../../deps.ts";
|
||||
import { version } from "../../version.ts";
|
||||
import { ScriptIdType } from "../script_id_type.ts";
|
||||
import { ConfigData } from "../../load_config.ts";
|
||||
@@ -30,6 +30,7 @@ export class VrCommand extends Command {
|
||||
})
|
||||
.command("run", new RunCommand(this.configData))
|
||||
.command("export", new ExportCommand(this.configData))
|
||||
.command("completions", new CompletionsCommand())
|
||||
.reset();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user