Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions cirro/cli/interactive/common_args.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
from typing import List

from cirro.api.models.project import Project
from cirro.cli.interactive.utils import prompt_wrapper
from cirro.cli.interactive.utils import ask


def ask_project(projects: List[Project], input_value: str) -> str:
project_names = [project.name for project in projects]
project_prompt = {
'type': 'list',
'name': 'project',
'message': 'What project is this dataset associated with?',
'choices': project_names,
'default': input_value if input_value in project_names else None
}
answers = prompt_wrapper(project_prompt)
return answers['project']
project_names = sorted([project.name for project in projects])
if len(project_names) <= 10:
return ask(
'select',
'What project is this dataset associated with?',
choices=project_names,
default=input_value if input_value in project_names else None
)
else:
return ask(
'autocomplete',
'What project is this dataset associated with? (use TAB to display options)',
choices=project_names,
default=input_value if input_value in project_names else ''
)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cirro"
version = "0.6.9"
version = "0.6.10"
description = "CLI tool and SDK for interacting with the Cirro platform"
authors = ["Fred Hutch <[email protected]>"]
license = "MIT"
Expand Down