Skip to content

Commit e4946d9

Browse files
committed
Added shell tab-completion documentation
1 parent 8dc7b84 commit e4946d9

4 files changed

Lines changed: 46 additions & 2 deletions

File tree

docs/en/build-script-runner-interactive.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22

3-
When executing flubu script or any other process locally in console it is recomended to run FlubuCore in interactive mode it gives you some really nice features which are listed in the [features section.](#features) To start FlubuCore interactive mode just execute command `flubu -i` in your favorite console.
3+
When executing flubu script or any other process locally in console it is recomended to run FlubuCore in interactive mode it gives you some really nice features which are listed in the [features section.](#features) To start FlubuCore interactive mode just execute command `flubu -i` in your favorite console.
4+
5+
> **Tip:** If you prefer standard terminal usage over interactive mode, FlubuCore also supports [shell tab completion](build-script-runner.md#shell-tab-completion) for bash, zsh, PowerShell, and fish.
46
57
## **Demo**
68
![Interactive mode in action](https://raw.githubusercontent.com/flubu-core/flubu.core/master/assets/FlubuCore_Interactive_mode_full.gif)

docs/en/build-script-runner.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,45 @@ It displays all tasks with description that will be executed by target. It also
5050
that you don't need to execute script at the root directory of the project. Meaning if your project is for example located at "c:\_git\myproject" you can execute script inside any subfolder of that location. The location where a
5151
.flubu file is found will be used as the "work directory" during a build process, and a correct "work directory" is crucial to use relative paths in our build scripts.
5252

53+
### **Shell tab completion**
54+
55+
FlubuCore supports shell tab completion for target names, options, and script arguments. Once set up, you can type `flubu <tab>` and get completions directly in your terminal — no need to run `flubu help` or switch to interactive mode.
56+
57+
#### Setup
58+
59+
Add one of the following to your shell profile:
60+
61+
**Bash** (~/.bashrc):
62+
```bash
63+
eval "$(flubu --setup-completions bash)"
64+
```
65+
66+
**Zsh** (~/.zshrc):
67+
```bash
68+
eval "$(flubu --setup-completions zsh)"
69+
```
70+
71+
**PowerShell** ($PROFILE):
72+
```powershell
73+
flubu --setup-completions pwsh | Invoke-Expression
74+
```
75+
76+
**Fish** (~/.config/fish/config.fish):
77+
```fish
78+
flubu --setup-completions fish | source
79+
```
80+
81+
#### What completes
82+
83+
| Input | Completes with |
84+
|-------|---------------|
85+
| `flubu <tab>` | All target names from your build script |
86+
| `flubu cl<tab>` | Targets starting with "cl" (e.g. `clean`) |
87+
| `flubu --<tab>` | Options: `--parallel`, `--dryRun`, `--noColor`, `--nodeps`, `--script`, etc. |
88+
| `flubu -<tab>` | Script arguments defined with `[FromArg]` attributes |
89+
90+
Completions are dynamic — targets are discovered from your build script on each tab press. When you add a new target and save the file, it appears in completions immediately.
91+
5392
### **Default build script locations**
5493

5594
- "Build.cs"

docs/en/getting-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ project.json:
6969
- .net core sdk 2.1.300 or greater must be installed.
7070
- Install FlubuCore local or global tool: `dotnet tool install --global FlubuCore.Tool`
7171
- Run `flubu compile` where build script is located. It will compile your solution.
72+
- Optionally enable [shell tab completion](build-script-runner.md#shell-tab-completion) for target and option completions in your terminal.
7273

7374
This is very basic build script just for you to see how simple it is to get you started. FlubuCore has to offer a lot of nice features. Read more about them at [Build script fundamentals].
7475
You should also take a look at [.net core examples] they will give you hints how to write your build script and see most of the main flubu features in action.

docs/en/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,12 @@ public class BuildScript : DefaultBuildScript
186186
187187
* [Possibility to use FlubuCore tasks in any other .NET application.](https://github.com/flubu-core/examples/blob/master/NetCore_csproj/BuildScript/BuildScriptTests.cs)
188188
189-
* [FlubuCore interactive mode](https://flubucore.dotnetcore.xyz/build-script-runner-interactive/) which offers target tab completition, options tab completition, toogle targets/options, executed commands history. It is also possible to execute external commands and operable programs. For some of them FlubuCore offers tab completion with help displayed at the bottom of console out of the box(such as dotnet, git..)
189+
* [FlubuCore interactive mode](https://flubucore.dotnetcore.xyz/build-script-runner-interactive/) which offers target tab completition, options tab completition, toogle targets/options, executed commands history. It is also possible to execute external commands and operable programs. For some of them FlubuCore offers tab completion with help displayed at the bottom of console out of the box(such as dotnet, git..)
190190
191191
![FlubuCore interactive mode](https://raw.githubusercontent.com/dotnetcore/flubu.core/master/assets/FlubuCore_Interactive_mode_full.gif)
192192
193+
* [Shell tab completion](https://flubucore.dotnetcore.xyz/build-script-runner/#shell-tab-completion) for bash, zsh, PowerShell, and fish. Get target and option completions directly in your terminal without entering interactive mode.
194+
193195
* Improved developer experience with FlubuCore custom analyzers.
194196

195197
![FlubuCore analyzers in action](https://raw.githubusercontent.com/flubu-core/flubu.core/master/assets/FlubuCoreCustomAnalyzerDemo.png)

0 commit comments

Comments
 (0)