Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: updated instructions #264

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/src/carapace-spec/command/name.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ It can also contain the one-line [usage](https://rsteube.github.io/carapace/cara
```yaml
name: add [-F file | -D dir]... [-f format] profile
```

> Recommended syntax is as [follows](https://pkg.go.dev/github.com/spf13/cobra#Command):
> - `[ ]` identifies an optional argument. Arguments that are not enclosed in brackets are required.
> - `...` indicates that you can specify multiple values for the previous argument.
> - `|` indicates mutually exclusive information. You can use the argument to the left of the separator or the argument to the right of the separator. You cannot use both arguments in a single use of the command.
> - `{ }` delimits a set of mutually exclusive arguments when one of the arguments is required. If the arguments are optional, they are enclosed in brackets ([ ]).
71 changes: 53 additions & 18 deletions docs/src/carapace-spec/usage.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,65 @@
# Usage

## Bash
```sh
# bash
source <(carapace-spec example.yaml)
# ~/.bashrc
source <(carapace-spec example/pkill.yaml)
```
![](./usage/bash.png)

# elvish
eval (carapace-spec example.yaml|slurp)
## Elvish
```sh
# ~/.config/elvish/rc.elv
eval (carapace-spec example/pkill.yaml|slurp)
```
![](./usage/elvish.png)

# fish
carapace-spec example.yaml | source
## Fish
```sh
# ~/.config/fish/config.fish
carapace-spec example/pkill.yaml | source
```
![](./usage/fish.png)

# oil
source <(carapace-spec example.yaml)
## Nushell
> update config.nu according to [Multiple Completer](http://www.nushell.sh/cookbook/external_completers.html#multiple-completer))
```sh
#~/.config/nushell/config.nu
carapace-spec example/pkill.yaml
```
![](./usage/nushell.png)

# nushell (update config.nu according to output)
carapace-spec example.yaml
## Oil
```sh
# ~/.config/oil/oshrc
source <(carapace-spec example/pkill.yaml)
```
![](./usage/oil.png)

# powershell
carapace-spec example.yaml | Out-String | Invoke-Expression
## Powershell
```sh
# ~/.config/powershell/Microsoft.PowerShell_profile.ps1
carapace-spec example/pkill.yaml | Out-String | Invoke-Expression
```
![](./usage/powershell.png)

# tcsh
eval `carapace-spec example.yaml`
# Tcsh
```sh
## ~/.tcshrc
eval `carapace-spec example/pkill.yaml`
```
![](./usage/tcsh.png)

# xonsh
exec($(carapace-spec example.yaml))
## Xonsh
```sh
# ~/.config/xonsh/rc.xsh
exec($(carapace-spec example/pkill.yaml))
```
![](./usage/xonsh.png)

# zsh
source <(carapace-spec example.yaml)
## Zsh
```sh
# ~/.zshrc
source <(carapace-spec example/pkill.yaml)
```
![](./usage/zsh.png)
Binary file added docs/src/carapace-spec/usage/bash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/carapace-spec/usage/elvish.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/carapace-spec/usage/fish.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/carapace-spec/usage/nushell.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/carapace-spec/usage/oil.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/carapace-spec/usage/powershell.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/carapace-spec/usage/tcsh.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/carapace-spec/usage/xonsh.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/carapace-spec/usage/zsh.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.