From 4778a36275cd140413a407455e20dbeb1c9e8b58 Mon Sep 17 00:00:00 2001 From: Hellow Date: Wed, 12 Apr 2023 13:02:19 +0200 Subject: [PATCH] added some essential arguments --- src/music_kraken/__main__.py | 47 ++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/src/music_kraken/__main__.py b/src/music_kraken/__main__.py index 10c86b8..aa27aaf 100644 --- a/src/music_kraken/__main__.py +++ b/src/music_kraken/__main__.py @@ -2,5 +2,48 @@ import music_kraken if __name__ == "__main__": - music_kraken.cli() - \ No newline at end of file + import argparse + + parser = argparse.ArgumentParser( + description="A simple cli to easily test music_kraken. The full cli is in the making." + ) + + # arguments for debug purposes + parser.add_argument( + '-v', '--verbose', + action="store_true", + help="Sets the logging level to debug." + ) + + parser.add_argument( + '-t', '--test', + action="store_true", + help="For the sake of testing. Equals: '-v -g test'" + ) + + # general arguments + parser.add_argument( + '-g', '--genre', + help="Specifies the genre. (Will be overwritten by -t)" + ) + + parser.add_argument( + '-a', '--all', + action="store_true", + help="If set it will download EVERYTHING the music downloader can find.\n" + "For example weird compilations from musify." + ) + + arguments = parser.parse_args() + + if arguments.verbose or arguments.test: + import logging + print("Setting logging-level to DEBUG") + logging.getLogger().setLevel(logging.DEBUG) + + # getting the genre + genre: str = arguments.genre + if arguments.test: + genre = "test" + + music_kraken.cli(genre=genre, download_all=arguments.all)