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

Function interactiveChoice

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

Source from the content-addressed store, hash-verified

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

Callers 1

interactiveRepoEditFunction · 0.85

Calls 1

MultiSelectMethod · 0.65

Tested by

no test coverage detected