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

feat: carapace completion for all major shells #1436

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ rm -rf "~/.fzf"
flatpak uninstall io.mpv.Mpv
```
* iOS
```
```sh
rm -rf /usr/local/bin/ani-cli
```
To uninstall other dependencies:
Expand All @@ -504,19 +504,27 @@ apk del grep sed curl fzf git aria2 ffmpeg ncurses
### bash

To add tab completions using bash run the following command inside the ani-cli directory
```
```sh
cp _ani-cli-bash /path/to/your/completions
echo "source /path/to/your/completions/_ani-cli-bash" >> ~/.bashrc
```

### zsh

To add tab completions using zsh run the following command inside the ani-cli directory
```
```sh
cp _ani-cli-zsh /path/to/your/completions
echo "source /path/to/your/completions/_ani-cli-zsh" >> ~/.zshrc
```

### Cross-Shell (with [Carapace](https://github.com/carapace-sh/carapace))

See the [setup](https://carapace-sh.github.io/carapace-bin/setup.html) guide on Carapace for your specific shell.
To add tab completions using zsh run the following command inside the ani-cli directory
```sh
cp ani-cli.toml $HOME/.config/carapace/specs/ani-cli.yaml
# Restart your shell for good measure
``````
## Dependencies

- grep
Expand Down Expand Up @@ -545,7 +553,7 @@ Ani-skip uses the external lua script function of mpv and as such – for now

## FAQ
<details>

* Can I change subtitle language or turn them off? - No, the subtitles are baked into the video.
* Can I watch dub? - Yes, use `--dub`.
* Can I change dub language? - No.
Expand Down
29 changes: 29 additions & 0 deletions ani-cli.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# yaml-language-server: $schema=https://carapace.sh/schemas/command.json
name: ani-cli
flags:
-c: Continue watching from history
-d, --download: Download the video instead of playing it
-D, --delete: Delete history
-l, --logview: Show logs
-s, --syncplay: Use Syncplay to watch with friends
-S, --select-nth: Select nth entry
-q, --quality=: Specify the video quality
-v, --vlc: Use VLC to play the video
-V, --version: Show the version of the script
-e, --episode=: Specify the episode to watch
-r, --range=: Specify the range of episodes to watch
--dub: Play dubbed version
--rofi: Use rofi instead of fzf for the interactive menu
--skip: Use ani-skip to skip the intro of the episode (mpv only)
--no-detach: Don't detach the player (mpv only)
--exit-after-play: Exit the player, and return the player exit code (mpv only)
--skip-title=: Use given title as ani-skip query
-N, --nextep-countdown: Display a countdown to the next episode
-U, --update: Update the script
persistentflags:
-h, --help: Show this help message and exit
completion:
flag:
quality: ["480p", "720p", "1080p", "4K"] # Add supported qualities
episode: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"] # Example episode numbers or ranges
range: [ "1-13","1-26","1-3", "2-4", "3-4", "5-6"] # Example ranges
Loading