Skip to content

Commit

Permalink
using Literal in cli for argument 'selection'
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaMarconato committed Jul 14, 2023
1 parent 0016c1b commit cf69230
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/spatialdata/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
various operations through a terminal. Currently, it implements the "peek" function, which allows users to inspect
the contents of a SpatialData .zarr dataset. Additional CLI functionalities will be implemented in the future.
"""
from typing import Literal

import click


@click.command(help="Peek inside the SpatialData .zarr dataset")
@click.argument("path", default=False, type=str)
@click.argument("selection", type=str, nargs=-1)
def peek(path: str, selection: tuple[str]) -> None:
@click.argument("selection", type=click.Choice(["images", "labels", "points", "shapes", "table"]), nargs=-1)
def peek(path: str, selection: tuple[Literal["images", "labels", "points", "shapes", "table"]]) -> None:
"""
Peek inside the SpatialData .zarr dataset.
Expand Down

0 comments on commit cf69230

Please sign in to comment.