Skip to content

Commit 00b3107

Browse files
committed
Improve error message
1 parent 6e6a0e4 commit 00b3107

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cmd/browsers.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,8 +1893,16 @@ var browsersUpdateCmd = &cobra.Command{
18931893
Use: "update <id>",
18941894
Short: "Update a browser session",
18951895
Long: "Update a running browser session. Currently supports changing or removing the proxy.",
1896-
Args: cobra.ExactArgs(1),
1897-
RunE: runBrowsersUpdate,
1896+
Args: func(cmd *cobra.Command, args []string) error {
1897+
if len(args) == 0 {
1898+
return fmt.Errorf("missing required argument: browser ID\n\nUsage: kernel browsers update <id> [flags]")
1899+
}
1900+
if len(args) > 1 {
1901+
return fmt.Errorf("expected 1 argument (browser ID), got %d", len(args))
1902+
}
1903+
return nil
1904+
},
1905+
RunE: runBrowsersUpdate,
18981906
}
18991907

19001908
func init() {

0 commit comments

Comments
 (0)