From 4bac2acc79afa3f4c30739feb94581742d6f436a Mon Sep 17 00:00:00 2001 From: shagi Date: Sat, 7 Nov 2020 10:31:48 +0100 Subject: [PATCH] Use configuration file --- negromate/karaoke/commands/karaoke.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/negromate/karaoke/commands/karaoke.py b/negromate/karaoke/commands/karaoke.py index f91965e..b2da81c 100644 --- a/negromate/karaoke/commands/karaoke.py +++ b/negromate/karaoke/commands/karaoke.py @@ -4,12 +4,14 @@ name = 'karaoke' help_text = 'GUI for negromate karaoke' -def options(parser): +def options(parser, config, **kwargs): parser.add_argument( - 'song_folder', type=Path, - help="Folder with the song database.") + '-s', '--song_folder', type=Path, + default=config['global']['song_folder'], + help="Folder with the song database, defaults to {}".format( + config['global']['song_folder'])) -def run(args): +def run(args, **kwargs): from ..karaoke import main - main(args.song_folder) + main(args.song_folder.expanduser())