mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-17 08:35:08 -04:00
Move —reset-config option to config subcommand
This commit is contained in:
parent
24b858fad7
commit
b988ee86a7
1 changed files with 3 additions and 10 deletions
|
@ -24,7 +24,6 @@ if not os.path.isdir(CACHE_DIR):
|
|||
@click.option("-t", "--text", metavar="PATH")
|
||||
@click.option("-nd", "--no-db", is_flag=True)
|
||||
@click.option("--debug", is_flag=True)
|
||||
@click.option("--reset-config", is_flag=True)
|
||||
@click.pass_context
|
||||
def cli(ctx, **kwargs):
|
||||
""""""
|
||||
|
@ -35,9 +34,6 @@ def cli(ctx, **kwargs):
|
|||
init_log()
|
||||
|
||||
config = Config()
|
||||
if kwargs["reset_config"]:
|
||||
config.reset()
|
||||
return
|
||||
|
||||
if kwargs["no_db"]:
|
||||
config.session["database"]["enabled"] = False
|
||||
|
@ -176,10 +172,12 @@ def discover(ctx, **kwargs):
|
|||
@cli.command()
|
||||
@click.option("-o", "--open", is_flag=True, help="Open the config file")
|
||||
@click.option("-q", "--qobuz", is_flag=True, help="Set Qobuz credentials")
|
||||
@click.option("-t", "--tidal", is_flag=True, help="Set Tidal credentials")
|
||||
@click.option("--reset", is_flag=True, help='RESET the config file')
|
||||
@click.pass_context
|
||||
def config(ctx, **kwargs):
|
||||
"""Manage the streamrip configuration."""
|
||||
if kwargs['reset']:
|
||||
config.reset()
|
||||
|
||||
if kwargs["open"]:
|
||||
click.launch(CONFIG_PATH)
|
||||
|
@ -189,11 +187,6 @@ def config(ctx, **kwargs):
|
|||
config.file["qobuz"]["password"] = getpass()
|
||||
config.save()
|
||||
|
||||
if kwargs["tidal"]:
|
||||
config.file["tidal"]["email"] = input("Tidal email: ")
|
||||
config.file["tidal"]["password"] = getpass()
|
||||
config.save()
|
||||
|
||||
|
||||
def none_chosen():
|
||||
click.secho("No items chosen, exiting.", fg="bright_red")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue