config docs, add --locate to config

This commit is contained in:
oskvr37
2025-02-09 15:22:36 +01:00
parent 7f7cfe6b4c
commit 3158f795cc
+19 -4
View File
@@ -8,12 +8,27 @@ from tiddl.config import CONFIG_PATH
"--open",
"-o",
is_flag=True,
help="Open the configuration file with the default editor",
help="Open the configuration file with the default editor.",
)
def ConfigCommand(open: bool):
"""Print path to the configuration file."""
@click.option(
"--locate",
"-l",
is_flag=True,
help="Launch a file manager with the located configuration file.",
)
def ConfigCommand(open: bool, locate: bool):
"""
Configuration file options.
click.echo(str(CONFIG_PATH))
By default it prints location of tiddl config file.
This command can be used in variable like `vim $(tiddl config)`
- this will open your config with vim editor.
"""
if open:
click.launch(str(CONFIG_PATH))
elif locate:
click.launch(str(CONFIG_PATH), locate=True)
else:
click.echo(str(CONFIG_PATH))