mirror of
https://github.com/oskvr37/tiddl.git
synced 2026-08-03 13:27:06 +03:00
✨ config docs, add --locate to config
This commit is contained in:
+19
-4
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user