mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-17 16:45:13 -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("-t", "--text", metavar="PATH")
|
||||||
@click.option("-nd", "--no-db", is_flag=True)
|
@click.option("-nd", "--no-db", is_flag=True)
|
||||||
@click.option("--debug", is_flag=True)
|
@click.option("--debug", is_flag=True)
|
||||||
@click.option("--reset-config", is_flag=True)
|
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def cli(ctx, **kwargs):
|
def cli(ctx, **kwargs):
|
||||||
""""""
|
""""""
|
||||||
|
@ -35,9 +34,6 @@ def cli(ctx, **kwargs):
|
||||||
init_log()
|
init_log()
|
||||||
|
|
||||||
config = Config()
|
config = Config()
|
||||||
if kwargs["reset_config"]:
|
|
||||||
config.reset()
|
|
||||||
return
|
|
||||||
|
|
||||||
if kwargs["no_db"]:
|
if kwargs["no_db"]:
|
||||||
config.session["database"]["enabled"] = False
|
config.session["database"]["enabled"] = False
|
||||||
|
@ -176,10 +172,12 @@ def discover(ctx, **kwargs):
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@click.option("-o", "--open", is_flag=True, help="Open the config file")
|
@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("-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
|
@click.pass_context
|
||||||
def config(ctx, **kwargs):
|
def config(ctx, **kwargs):
|
||||||
"""Manage the streamrip configuration."""
|
"""Manage the streamrip configuration."""
|
||||||
|
if kwargs['reset']:
|
||||||
|
config.reset()
|
||||||
|
|
||||||
if kwargs["open"]:
|
if kwargs["open"]:
|
||||||
click.launch(CONFIG_PATH)
|
click.launch(CONFIG_PATH)
|
||||||
|
@ -189,11 +187,6 @@ def config(ctx, **kwargs):
|
||||||
config.file["qobuz"]["password"] = getpass()
|
config.file["qobuz"]["password"] = getpass()
|
||||||
config.save()
|
config.save()
|
||||||
|
|
||||||
if kwargs["tidal"]:
|
|
||||||
config.file["tidal"]["email"] = input("Tidal email: ")
|
|
||||||
config.file["tidal"]["password"] = getpass()
|
|
||||||
config.save()
|
|
||||||
|
|
||||||
|
|
||||||
def none_chosen():
|
def none_chosen():
|
||||||
click.secho("No items chosen, exiting.", fg="bright_red")
|
click.secho("No items chosen, exiting.", fg="bright_red")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue