put more cli

This commit is contained in:
Justus Kuhlmann 2024-08-26 12:48:51 +00:00
commit 975501635a
3 changed files with 22 additions and 6 deletions

View file

@ -3,6 +3,7 @@ import typer
from corrlib import __app_name__, __version__
from .initialization import create
from .toml import import_toml
from .find import find_record
app = typer.Typer()
@ -12,13 +13,26 @@ def _version_callback(value: bool) -> None:
raise typer.Exit()
@app.command()
def find(
path: str = typer.Option(
str('./corrlib'),
"--dataset",
"-d",
),
ensemble: str = typer.Argument(),
corr: str = typer.Argument(),
) -> None:
results = find_record(path, ensemble, corr)
print(results)
@app.command()
def importer(
path: str = typer.Option(
str('./corrlib'),
"--dataset",
"-d",
prompt="Which corrlib instance?"
),
file: str = typer.Argument(
),
@ -26,9 +40,11 @@ def importer(
bool(True),
"--save",
"-s",
prompt="Copy config file?",
),
) -> None:
"""
Import a project from a .toml-file via CLI.
"""
import_toml(path, file, copy_file)
return
@ -39,9 +55,11 @@ def init(
str('./corrlib'),
"--dataset",
"-d",
prompt="Dataset location?",
),
) -> None:
"""
Initialize a new backlog-database.
"""
create(path)
return