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