mirror of
https://github.com/dtomlinson91/tembo.git
synced 2025-12-22 07:55:45 +00:00
fleshing out initial cli
This commit is contained in:
36
tembo/cli.py
36
tembo/cli.py
@@ -2,8 +2,10 @@ import click
|
||||
|
||||
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():
|
||||
"""
|
||||
Tembo - an organiser for work notes.
|
||||
@@ -12,16 +14,40 @@ def run():
|
||||
# print(tembo.CONFIG.scopes)
|
||||
|
||||
|
||||
@run.command(options_metavar="<options>")
|
||||
@click.argument("scope")
|
||||
def new(scope):
|
||||
@click.command(options_metavar="<options>")
|
||||
@click.argument("scope", metavar="<scope>")
|
||||
@click.argument(
|
||||
"inputs",
|
||||
nargs=-1,
|
||||
metavar="<inputs>",
|
||||
)
|
||||
def new(scope, inputs):
|
||||
"""
|
||||
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:
|
||||
print(f"passed in scope: {scope}")
|
||||
print(f'config scope: {user_scope["name"]}')
|
||||
if user_scope["name"] == scope:
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user