Skip to content

Allow the user to provide a project name#13

Merged
bbc2 merged 1 commit intomasterfrom
project-name
Feb 15, 2022
Merged

Allow the user to provide a project name#13
bbc2 merged 1 commit intomasterfrom
project-name

Conversation

@bbc2
Copy link
Copy Markdown
Member

@bbc2 bbc2 commented Feb 14, 2022

A project name can now be given instead of a project ID. The new option is --project-name and is mutually exclusive with --project-id.

Currently, since our API lacks a way to get a Project by name directly, the tool downloads the full list of project IDs and names to determine which one matches the user-provided name.

@bbc2 bbc2 self-assigned this Feb 14, 2022
Copy link
Copy Markdown

@ian-barnes ian-barnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Comment thread cs_api_cli/cs_api_cli.ml Outdated
>>= fun body ->
let projects = Cs_api_core.parse_list_projects_response ~body in
match CCList.Assoc.get ~eq:String.equal name projects with
| None -> Lwt_result.fail "Project not found"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a tiny point, but perhaps it would be more helpful to say "Project \"" ^ name ^ "\" not found" or something like that?

A project name can now be given instead of a project ID. The new option
is `--project-name`.
@bbc2 bbc2 merged commit c417675 into master Feb 15, 2022
@bbc2 bbc2 deleted the project-name branch February 15, 2022 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants