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

Function interactiveChoice

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

Source from the content-addressed store, hash-verified

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

Callers 1

interactiveRepoEditFunction · 0.85

Calls 1

MultiSelectMethod · 0.65

Tested by

no test coverage detected