MCPcopy Create free account
hub / github.com/cli/cli / interactiveChoice

Function interactiveChoice

pkg/cmd/repo/edit/edit.go:362–390  ·  view source on GitHub ↗
(p iprompter, r *api.Repository)

Source from the content-addressed store, hash-verified

360}
361
362func interactiveChoice(p iprompter, r *api.Repository) ([]string, error) {
363 options := []string{
364 optionDefaultBranchName,
365 optionDescription,
366 optionHomePageURL,
367 optionIssues,
368 optionMergeOptions,
369 optionProjects,
370 // TODO: GitHub Enterprise Server does not support has_discussions yet
371 // optionDiscussions,
372 optionTemplateRepo,
373 optionTopics,
374 optionVisibility,
375 optionWikis,
376 }
377 if r.IsInOrganization {
378 options = append(options, optionAllowForking)
379 }
380 var answers []string
381 selected, err := p.MultiSelect("What do you want to edit?", nil, options)
382 if err != nil {
383 return nil, err
384 }
385 for _, i := range selected {
386 answers = append(answers, options[i])
387 }
388
389 return answers, err
390}
391
392func interactiveRepoEdit(opts *EditOptions, r *api.Repository) error {
393 for _, v := range r.RepositoryTopics.Nodes {

Callers 1

interactiveRepoEditFunction · 0.85

Calls 1

MultiSelectMethod · 0.65

Tested by

no test coverage detected