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

Function editArgs

pkg/cmd/project/edit/edit.go:119–145  ·  view source on GitHub ↗
(config editConfig)

Source from the content-addressed store, hash-verified

117}
118
119func editArgs(config editConfig) (*updateProjectMutation, map[string]interface{}) {
120 variables := githubv4.UpdateProjectV2Input{ProjectID: githubv4.ID(config.opts.projectID)}
121 if config.opts.title != "" {
122 variables.Title = githubv4.NewString(githubv4.String(config.opts.title))
123 }
124 if config.opts.shortDescription != "" {
125 variables.ShortDescription = githubv4.NewString(githubv4.String(config.opts.shortDescription))
126 }
127 if config.opts.readme != "" {
128 variables.Readme = githubv4.NewString(githubv4.String(config.opts.readme))
129 }
130 if config.opts.visibility != "" {
131 if config.opts.visibility == projectVisibilityPublic {
132 variables.Public = githubv4.NewBoolean(githubv4.Boolean(true))
133 } else if config.opts.visibility == projectVisibilityPrivate {
134 variables.Public = githubv4.NewBoolean(githubv4.Boolean(false))
135 }
136 }
137
138 return &updateProjectMutation{}, map[string]interface{}{
139 "input": variables,
140 "firstItems": githubv4.Int(0),
141 "afterItems": (*githubv4.String)(nil),
142 "firstFields": githubv4.Int(0),
143 "afterFields": (*githubv4.String)(nil),
144 }
145}
146
147func printResults(config editConfig, project queries.ProjectMutationQuery) error {
148 if !config.io.IsStdoutTTY() {

Callers 1

runEditFunction · 0.85

Calls 2

IDMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected