File tree Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 11from typing import List
22
33from cirro .api .models .project import Project
4- from cirro .cli .interactive .utils import prompt_wrapper
4+ from cirro .cli .interactive .utils import ask
55
66
77def ask_project (projects : List [Project ], input_value : str ) -> str :
8- project_names = [project .name for project in projects ]
9- project_prompt = {
10- 'type' : 'list' ,
11- 'name' : 'project' ,
12- 'message' : 'What project is this dataset associated with?' ,
13- 'choices' : project_names ,
14- 'default' : input_value if input_value in project_names else None
15- }
16- answers = prompt_wrapper (project_prompt )
17- return answers ['project' ]
8+ project_names = sorted ([project .name for project in projects ])
9+ if len (project_names ) <= 10 :
10+ return ask (
11+ 'select' ,
12+ 'What project is this dataset associated with?' ,
13+ choices = project_names ,
14+ default = input_value if input_value in project_names else None
15+ )
16+ else :
17+ return ask (
18+ 'autocomplete' ,
19+ 'What project is this dataset associated with? (use TAB to display options)' ,
20+ choices = project_names ,
21+ default = input_value if input_value in project_names else ''
22+ )
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " cirro"
3- version = " 0.6.9 "
3+ version = " 0.6.10 "
44description = " CLI tool and SDK for interacting with the Cirro platform"
55authors = [
" Fred Hutch <[email protected] >" ]
66license = " MIT"
You can’t perform that action at this time.
0 commit comments