From 9cfa3aeea579189a9fc23bb486dba8b022db8229 Mon Sep 17 00:00:00 2001 From: Benex254 Date: Fri, 16 Aug 2024 19:45:00 +0300 Subject: [PATCH] feat(cli): use an option for providing anime title for search and download command --- fastanime/cli/commands/download.py | 9 +++++++-- fastanime/cli/commands/search.py | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/fastanime/cli/commands/download.py b/fastanime/cli/commands/download.py index 424fdbc..025301e 100644 --- a/fastanime/cli/commands/download.py +++ b/fastanime/cli/commands/download.py @@ -13,8 +13,13 @@ if TYPE_CHECKING: help="Download anime using the anime provider for a specified range", short_help="Download anime", ) -@click.argument( - "anime-titles", required=True, shell_complete=anime_titles_shell_complete, nargs=-1 +@click.option( + "--anime-titles", + "--anime_title", + "-t", + required=True, + shell_complete=anime_titles_shell_complete, + multiple=True, ) @click.option( "--episode-range", diff --git a/fastanime/cli/commands/search.py b/fastanime/cli/commands/search.py index b014df1..4c85a75 100644 --- a/fastanime/cli/commands/search.py +++ b/fastanime/cli/commands/search.py @@ -8,8 +8,13 @@ from ..completion_functions import anime_titles_shell_complete help="This subcommand directly interacts with the provider to enable basic streaming. Useful for binging anime.", short_help="Binge anime", ) -@click.argument( - "anime_titles", required=True, shell_complete=anime_titles_shell_complete, nargs=-1 +@click.option( + "--anime-titles", + "--anime_title", + "-t", + required=True, + shell_complete=anime_titles_shell_complete, + multiple=True, ) @click.option( "--episode-range",