diff --git a/internal/codespaces/portforwarder/port_forwarder.go b/internal/codespaces/portforwarder/port_forwarder.go index 7f696c1a497..b24f8f637f5 100644 --- a/internal/codespaces/portforwarder/port_forwarder.go +++ b/internal/codespaces/portforwarder/port_forwarder.go @@ -264,7 +264,11 @@ func (fwd *CodespacesPortForwarder) UpdatePortVisibility(ctx context.Context, re } // Delete the existing tunnel port to update - err = fwd.connection.TunnelManager.DeleteTunnelPort(ctx, fwd.connection.Tunnel, uint16(remotePort), fwd.connection.Options) + port, err := convertIntToUint16(remotePort) + if err != nil { + return fmt.Errorf("error converting port: %w", err) + } + err = fwd.connection.TunnelManager.DeleteTunnelPort(ctx, fwd.connection.Tunnel, port, fwd.connection.Options) if err != nil { return fmt.Errorf("error deleting tunnel port: %w", err) } diff --git a/pkg/cmd/issue/close/close.go b/pkg/cmd/issue/close/close.go index 19510bf89a9..4c1c7d382bf 100644 --- a/pkg/cmd/issue/close/close.go +++ b/pkg/cmd/issue/close/close.go @@ -5,6 +5,7 @@ import ( "net/http" "time" + "github.com/MakeNowJust/heredoc" "github.com/cli/cli/v2/api" fd "github.com/cli/cli/v2/internal/featuredetection" "github.com/cli/cli/v2/internal/ghrepo" @@ -38,7 +39,20 @@ func NewCmdClose(f *cmdutil.Factory, runF func(*CloseOptions) error) *cobra.Comm cmd := &cobra.Command{ Use: "close { | }", Short: "Close issue", - Args: cobra.ExactArgs(1), + Example: heredoc.Doc(` + # Close issue + $ gh issue close 123 + + # Close issue and add a closing comment + $ gh issue close 123 --comment "Closing this issue" + + # Close issue as a duplicate of issue #456 + $ gh issue close 123 --duplicate-of 456 + + # Close issue as not planned + $ gh issue close 123 --reason "not planned" + `), + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { issueNumber, baseRepo, err := shared.ParseIssueFromArg(args[0]) if err != nil {