X Tutup
Skip to content

Commit a55f7af

Browse files
committed
Correct wrong args constraints
1 parent 32d3a38 commit a55f7af

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cmd/ghcs/code.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func newCodeCmd() *cobra.Command {
1919
codeCmd := &cobra.Command{
2020
Use: "code",
2121
Short: "Open a codespace in VS Code",
22-
Args: cobra.MaximumNArgs(1),
22+
Args: cobra.NoArgs,
2323
RunE: func(cmd *cobra.Command, args []string) error {
2424
return code(codespace, useInsiders)
2525
},

cmd/ghcs/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func newLogsCmd() *cobra.Command {
2424
logsCmd := &cobra.Command{
2525
Use: "logs",
2626
Short: "Access codespace logs",
27-
Args: cobra.MaximumNArgs(1),
27+
Args: cobra.NoArgs,
2828
RunE: func(cmd *cobra.Command, args []string) error {
2929
return logs(context.Background(), log, codespace, follow)
3030
},

cmd/ghcs/ports.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func newPortsPublicCmd() *cobra.Command {
158158
return &cobra.Command{
159159
Use: "public <port>",
160160
Short: "Mark port as public",
161-
Args: cobra.MinimumNArgs(1),
161+
Args: cobra.ExactArgs(1),
162162
RunE: func(cmd *cobra.Command, args []string) error {
163163
codespace, err := cmd.Flags().GetString("codespace")
164164
if err != nil {
@@ -179,7 +179,7 @@ func newPortsPrivateCmd() *cobra.Command {
179179
return &cobra.Command{
180180
Use: "private <port>",
181181
Short: "Mark port as private",
182-
Args: cobra.MinimumNArgs(1),
182+
Args: cobra.ExactArgs(1),
183183
RunE: func(cmd *cobra.Command, args []string) error {
184184
codespace, err := cmd.Flags().GetString("codespace")
185185
if err != nil {

0 commit comments

Comments
 (0)
X Tutup