diff --git a/aim/cli/digifeeds.py b/aim/cli/digifeeds.py index 1f6736d..41cd529 100644 --- a/aim/cli/digifeeds.py +++ b/aim/cli/digifeeds.py @@ -1,4 +1,5 @@ import typer +from typing_extensions import Annotated from aim.digifeeds.add_to_db import add_to_db as add_to_digifeeds_db from aim.digifeeds.list_barcodes_in_bucket import list_barcodes_in_bucket from aim.digifeeds.database import models, main @@ -10,7 +11,19 @@ @app.command() -def add_to_db(barcode: str): +def add_to_db( + barcode: Annotated[ + str, + typer.Argument(help="The barcode to be added to the database"), + ], +): + """ + Add a barcode to the *Digifeeds Database* and then to the Alma Digifeeds Set + + If the barcode is in the database fetch it and then try to add it to the + Digifeeds set in Alma. If the barcode isn't found in Alma, print an error. + Print whether or not the item is added to the digifeeds set. + """ print(f'Adding barcode "{barcode}" to database') item = add_to_digifeeds_db(barcode) if item.has_status("not_found_in_alma"): diff --git a/aim/cli/main.py b/aim/cli/main.py index 49e62a1..a3b7d98 100644 --- a/aim/cli/main.py +++ b/aim/cli/main.py @@ -2,7 +2,9 @@ import aim.cli.digifeeds as digifeeds app = typer.Typer() -app.add_typer(digifeeds.app, name="digifeeds") +app.add_typer( + digifeeds.app, name="digifeeds", help="Commands related to the digifeeds process" +) if __name__ == "__main__": # pragma: no cover diff --git a/poetry.lock b/poetry.lock index fa53736..b8884e9 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1343,13 +1343,13 @@ tests = ["coverage (>=6.0.0)", "flake8", "mypy", "pytest (>=7.0.0)", "pytest-asy [[package]] name = "rich" -version = "13.8.1" +version = "13.9.2" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" optional = false -python-versions = ">=3.7.0" +python-versions = ">=3.8.0" files = [ - {file = "rich-13.8.1-py3-none-any.whl", hash = "sha256:1760a3c0848469b97b558fc61c85233e3dafb69c7a071b4d60c38099d3cd4c06"}, - {file = "rich-13.8.1.tar.gz", hash = "sha256:8260cda28e3db6bf04d2d1ef4dbc03ba80a824c88b0e7668a0f23126a424844a"}, + {file = "rich-13.9.2-py3-none-any.whl", hash = "sha256:8c82a3d3f8dcfe9e734771313e606b39d8247bb6b826e196f4914b333b743cf1"}, + {file = "rich-13.9.2.tar.gz", hash = "sha256:51a2c62057461aaf7152b4d611168f93a9fc73068f8ded2790f29fe2b5366d0c"}, ] [package.dependencies]