docs: update readme

This commit is contained in:
Benex254
2024-08-10 01:16:43 +03:00
parent 1bbc9506c2
commit c0e5f5dd49
2 changed files with 7 additions and 4 deletions

View File

@@ -44,6 +44,7 @@ Heavily inspired by [animdl](https://github.com/justfoolingaround/animdl), [magi
- [downloads subcommand](#downloads-subcommand)
- [config subcommand](#config-subcommand)
- [cache subcommand](#cache-subcommand)
- [completions subcommand](#completions-subcommand)
- [MPV specific commands](#mpv-specific-commands)
- [Added keybindings](#added-keybindings)
- [Added script messages](#added-script-messages)
@@ -380,6 +381,8 @@ Helper command to setup shell completions
**Syntax:**
```bash
# try to detect your shell and print completions
fastanime completions
# print fish completions
fastanime completions --fish
# print bash completions

View File

@@ -16,12 +16,12 @@ def completions(fish, zsh, bash):
except ImportError:
import os
shell = os.environ.get("SHELL", "")
if "fish" in shell:
shell_env = os.environ.get("SHELL", "")
if "fish" in shell_env:
current_shell = "fish"
elif "zsh" in shell:
elif "zsh" in shell_env:
current_shell = "zsh"
elif "bash" in shell:
elif "bash" in shell_env:
current_shell = "bash"
else:
current_shell = None