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

Function newPortsVisibilityCmd

pkg/cmd/codespace/ports.go:220–232  ·  view source on GitHub ↗
(app *App, selector *CodespaceSelector)

Source from the content-addressed store, hash-verified

218}
219
220func newPortsVisibilityCmd(app *App, selector *CodespaceSelector) *cobra.Command {
221 return &cobra.Command{
222 Use: "visibility <port>:{public|private|org}...",
223 Short: "Change the visibility of the forwarded port",
224 Example: heredoc.Doc(`
225 $ gh codespace ports visibility 80:org 3000:private 8000:public
226 `),
227 Args: cobra.MinimumNArgs(1),
228 RunE: func(cmd *cobra.Command, args []string) error {
229 return app.UpdatePortVisibility(cmd.Context(), selector, args)
230 },
231 }
232}
233
234func (a *App) UpdatePortVisibility(ctx context.Context, selector *CodespaceSelector, args []string) (err error) {
235 ports, err := a.parsePortVisibilities(args)

Callers 1

newPortsCmdFunction · 0.85

Calls 1

UpdatePortVisibilityMethod · 0.65

Tested by

no test coverage detected