From 31483465cd93d5994fe86f255e086ff23d732ca4 Mon Sep 17 00:00:00 2001 From: Hellow Date: Sat, 15 Apr 2023 19:39:25 +0200 Subject: [PATCH] cli option to print all music kraken paths --- src/music_kraken/__init__.py | 10 +++++++++- src/music_kraken/__main__.py | 11 +++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/music_kraken/__init__.py b/src/music_kraken/__init__.py index db687b8..a65156c 100644 --- a/src/music_kraken/__init__.py +++ b/src/music_kraken/__init__.py @@ -102,7 +102,12 @@ def settings( return True if name is not None and value is not None: - modify_setting(name, value, invalid_ok=False) + modify_setting(name, value, invalid_ok=True) + + print() + print_cute_message() + print() + return while True: print_settings() @@ -111,6 +116,9 @@ def settings( print() if input_.isdigit() and int(input_) < len(config): if modify_setting_by_index(int(input_)): + print() + print_cute_message() + print() return else: print("Please input a valid ID.") diff --git a/src/music_kraken/__main__.py b/src/music_kraken/__main__.py index 3d03bc5..29d0d2f 100644 --- a/src/music_kraken/__main__.py +++ b/src/music_kraken/__main__.py @@ -46,6 +46,13 @@ if __name__ == "__main__": action="store_true" ) + parser.add_argument( + '-s', + '--setting', + help="Modifies a setting directly.", + nargs=2 + ) + parser.add_argument( "--paths", "-p", @@ -64,6 +71,10 @@ if __name__ == "__main__": music_kraken.read() + if arguments.setting is not None: + music_kraken.settings(*arguments.setting) + exit() + if arguments.settings: music_kraken.settings() exit()