fleshing out initial cli

This commit is contained in:
2021-10-20 03:24:15 +01:00
parent 03d9d563b4
commit 51473e11d2

View File

@@ -2,8 +2,10 @@ import click
import tembo import tembo
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
@click.group(options_metavar="<options>")
@click.group(context_settings=CONTEXT_SETTINGS, options_metavar="<options>")
def run(): def run():
""" """
Tembo - an organiser for work notes. Tembo - an organiser for work notes.
@@ -12,16 +14,40 @@ def run():
# print(tembo.CONFIG.scopes) # print(tembo.CONFIG.scopes)
@run.command(options_metavar="<options>") @click.command(options_metavar="<options>")
@click.argument("scope") @click.argument("scope", metavar="<scope>")
def new(scope): @click.argument(
"inputs",
nargs=-1,
metavar="<inputs>",
)
def new(scope, inputs):
""" """
Create a new note. Create a new note.
SCOPE refers to the name of the scope in the Tembo config.yml. <scope> The name of the scope in the Tembo config.yml.
<inputs> Any input tokens needed in the Tembo config.yml.
Example: tembo new meeting my_presentation
""" """
for user_scope in tembo.CONFIG.scopes: for user_scope in tembo.CONFIG.scopes:
print(f"passed in scope: {scope}") print(f"passed in scope: {scope}")
print(f'config scope: {user_scope["name"]}') print(f'config scope: {user_scope["name"]}')
if user_scope["name"] == scope: if user_scope["name"] == scope:
print(True) print(True)
click.echo(inputs)
# TODO: decide on a date format to pass in
@click.command(options_metavar="<options>")
@click.option("--scope", "-s", help="The name of the scope in the Tembo config.yml.")
@click.option("--date", "-d", help="")
def archive(scope, date):
print(f"{scope}, {date}")
run.add_command(new)
run.add_command(archive)