MCPcopy Index your code
hub / github.com/cli/cli / interactiveChoice

Function interactiveChoice

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

Source from the content-addressed store, hash-verified

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

Callers 1

interactiveRepoEditFunction · 0.85

Calls 1

MultiSelectMethod · 0.65

Tested by

no test coverage detected