Skip to content

Commit cae9742

Browse files
committed
doc: updated git
1 parent 745fccf commit cae9742

File tree

5 files changed

+29
-6
lines changed

5 files changed

+29
-6
lines changed

docs/src/freckles.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
[Freckles] is based on [Carapace] and serves as an example application.
1010

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.
1212

1313
[Carapace]:https://carapace.sh
1414
[dotfile]:https://dotfiles.github.io/

docs/src/freckles/cmd/edit.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Completion is provided with a [custom action].
4040
>
4141
> ---
4242
>
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`.
4444
> By modifying the [Action] with [MultiParts] the segments get completed separately.
4545
>
4646
> ---

docs/src/freckles/cmd/git.md

+23
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,29 @@ Completion is provided with [`ActionCarapaceBin`].
1818

1919
![](./git/git.cast)
2020

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+
2139
[`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
2242
[Freckles]:https://github.com/carapace-sh/freckles
2343
[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

docs/src/freckles/cmd/init.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Creates a new [Git] repository at `~/.local/share/freckles`.
1212

1313
Alternatively an existing remote repository can be cloned with the `--clone` flag.
1414

15-
Completion is provided by [ActionRepositorySearch].
15+
Completion is provided with [ActionRepositorySearch].
1616

1717
```go
1818
{{#include ../../../../cmd/freckles/cmd/init.go:flagcompletion}}

docs/src/freckles/cmd/root.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1919
## Gen
2020

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).
2222

2323
```go
2424
{{#include ../../../../cmd/freckles/cmd/root.go:gen}}
@@ -70,7 +70,7 @@ freckles _carapace export freckles [ARGS]...
7070
> This has several benefits:
7171
> - it avoids the [startup delay] issue
7272
> - it provides a central registration point for all shells
73-
> - it enables [embedding] with [`bridge.ActionCarapaceBin`]
73+
> - it enables [embedding] with [`ActionCarapaceBin`]
7474
> - it uses the newest version of [Carapace] for shell integration
7575
7676
## Macro
@@ -88,7 +88,7 @@ freckles _carapace export freckles [ARGS]...
8888
> More on this at [Init#Clone](./init.md#clone) and [Edit#Action](./edit.md#action).
8989
9090
[#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
9292
[Actions]:https://carapace-sh.github.io/carapace/carapace/action.html
9393
[Carapace]:https://carapace.sh
9494
[Cobra]:https://github.com/spf13/cobra

0 commit comments

Comments
 (0)