diff --git a/streamrip/cli.py b/streamrip/cli.py index 90c8b19..f2448ee 100644 --- a/streamrip/cli.py +++ b/streamrip/cli.py @@ -275,6 +275,12 @@ def lastfm(ctx, source, url): help="Reset the config file, keeping the credentials", ) @click.option("-p", "--path", is_flag=True, help="Show the config file's path") +@click.option( + "-ov", + "--open-vim", + is_flag=True, + help="Open the config file in the vim text editor.", +) @click.pass_context def config(ctx, **kwargs): """Manage the streamrip configuration file.""" @@ -291,6 +297,9 @@ def config(ctx, **kwargs): click.secho(f"Opening {CONFIG_PATH}", fg="green") click.launch(CONFIG_PATH) + if kwargs["open_vim"]: + os.system(f"vim '{CONFIG_PATH}'") + if kwargs["directory"]: config_dir = os.path.dirname(CONFIG_PATH) click.secho(f"Opening {config_dir}", fg="green")