enable simple way to list ensembles in CLI

This commit is contained in:
Justus Kuhlmann 2025-03-31 13:58:51 +00:00
parent ecad536c9e
commit bd1468ad8f

View file

@ -5,6 +5,8 @@ from .initialization import create
from .toml import import_toml, update_project
from .find import find_record, find_project, list_projects
from .tools import str2list
import os
app = typer.Typer()
@ -42,9 +44,13 @@ def list(
List entities. (ensembles, projects)
"""
if entities in ['ensembles', 'Ensembles','ENSEMBLES']:
results = "List of ensembles"
print("Ensembles:")
for item in os.listdir(path + "/archive"):
if os.path.isdir(os.path.join(path + "/archive", item)):
print(item)
elif entities == 'projects':
results = list_projects(path)
print("Projects:")
header = "UUID".ljust(37) + "| Names"
print(header)
for project in results: