File tree 5 files changed +29
-6
lines changed
5 files changed +29
-6
lines changed Original file line number Diff line number Diff line change 8
8
9
9
[ Freckles] is based on [ Carapace] and serves as an example application.
10
10
11
- The following documentation thus covers implementation details and highlights how [ Carapace ] provides completion .
11
+ The following documentation thus covers implementation details and highlights how completions are provided .
12
12
13
13
[ Carapace ] :https://carapace.sh
14
14
[ dotfile ] :https://dotfiles.github.io/
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ Completion is provided with a [custom action].
40
40
>
41
41
> ---
42
42
>
43
- > The [Walk] function returns dotfiles with their full path within the repository: ` path/to/freckle ` .
43
+ > The [Walk] function returns dotfiles with their full path within the repository: ` path/to/file ` .
44
44
> By modifying the [Action] with [MultiParts] the segments get completed separately.
45
45
>
46
46
> ---
Original file line number Diff line number Diff line change @@ -18,6 +18,29 @@ Completion is provided with [`ActionCarapaceBin`].
18
18
19
19
![ ] ( ./git/git.cast )
20
20
21
+ > Without arguments [ ` ActionCarapaceBin ` ] completes all registered commands.
22
+ >
23
+ > Here, we limit it to ` git ` .
24
+ > But it could be even more specific by passing subcommands, flags and arguments.
25
+ >
26
+ > ---
27
+ >
28
+ > Just as above we change the directory with [ Chdir] to the repository.
29
+ >
30
+ > Note that [ Carapace] also supports generic modifications like ` -C <dir> ` with [ PreInvoke] .
31
+ >
32
+ > ---
33
+ >
34
+ > When fully embedding a command ` DisableFlagParsing: true ` is the right aproach.
35
+ >
36
+ > But for [ sudo] -like behaviour where the local command has flags as well there is [ SetInterspersed] .
37
+ > Disabling it stops flag parsing after the first positional argument.
38
+
21
39
[ `ActionCarapaceBin` ] :https://pkg.go.dev/github.com/carapace-sh/carapace-bridge/pkg/actions/bridge#ActionCarapaceBin
40
+ [ Carapace ] :https://carapace.sh
41
+ [ Chdir ] :https://carapace-sh.github.io/carapace/carapace/action/chdir.html
22
42
[ Freckles ] :https://github.com/carapace-sh/freckles
23
43
[ Git ] :https://git-scm.com/
44
+ [ sudo ] :https://github.com/carapace-sh/carapace-bin/blob/master/completers/sudo_completer/cmd/root.go
45
+ [ PreInvoke ] :https://carapace-sh.github.io/carapace/carapace/gen/preInvoke.html
46
+ [ SetInterspersed ] :https://pkg.go.dev/github.com/spf13/pflag#SetInterspersed
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Creates a new [Git] repository at `~/.local/share/freckles`.
12
12
13
13
Alternatively an existing remote repository can be cloned with the ` --clone ` flag.
14
14
15
- Completion is provided by [ ActionRepositorySearch] .
15
+ Completion is provided with [ ActionRepositorySearch] .
16
16
17
17
``` go
18
18
{{#include ../../../../cmd/freckles/cmd/init.go :flagcompletion}}
Original file line number Diff line number Diff line change 18
18
19
19
## Gen
20
20
21
- [ Gen] adds a hidden ` _carapace ` subcommand which handles [ script] ( #script ) generation, [ completions ] ( #export ) , and [ macros] ( #macro ) .
21
+ [ Gen] adds a hidden ` _carapace ` subcommand which handles [ script] ( #script ) generation, completion [ export ] ( #export ) , and [ macros] ( #macro ) .
22
22
23
23
``` go
24
24
{{#include ../../../../cmd/freckles/cmd/root.go :gen}}
@@ -70,7 +70,7 @@ freckles _carapace export freckles [ARGS]...
70
70
> This has several benefits:
71
71
> - it avoids the [startup delay] issue
72
72
> - it provides a central registration point for all shells
73
- > - it enables [embedding] with [`bridge. ActionCarapaceBin`]
73
+ > - it enables [embedding] with [`ActionCarapaceBin`]
74
74
> - it uses the newest version of [Carapace] for shell integration
75
75
76
76
# # Macro
@@ -88,7 +88,7 @@ freckles _carapace export freckles [ARGS]...
88
88
> More on this at [Init#Clone](./init.md#clone) and [Edit#Action](./edit.md#action).
89
89
90
90
[#1336]:https://github.com/carapace-sh/carapace-bin/issues/1336
91
- [`bridge. ActionCarapaceBin`]:https://pkg.go.dev/github.com/carapace-sh/carapace-bridge/pkg/actions/bridge#ActionCarapaceBin
91
+ [`ActionCarapaceBin`]:https://pkg.go.dev/github.com/carapace-sh/carapace-bridge/pkg/actions/bridge#ActionCarapaceBin
92
92
[Actions]:https://carapace-sh.github.io/carapace/carapace/action.html
93
93
[Carapace]:https://carapace.sh
94
94
[Cobra]:https://github.com/spf13/cobra
You can’t perform that action at this time.
0 commit comments