From c0e5f5dd497779baf7ef657ab410eb8f7a148ccb Mon Sep 17 00:00:00 2001 From: Benex254 Date: Sat, 10 Aug 2024 01:16:43 +0300 Subject: [PATCH] docs: update readme --- README.md | 3 +++ fastanime/cli/commands/completions.py | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c382113..223a90e 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/fastanime/cli/commands/completions.py b/fastanime/cli/commands/completions.py index f7f649a..49a8b32 100644 --- a/fastanime/cli/commands/completions.py +++ b/fastanime/cli/commands/completions.py @@ -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