Skip to content

Commit 6f5dc3b

Browse files
committed
tested locally and works
1 parent 975aadb commit 6f5dc3b

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

cmd/browsers.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,7 +1989,7 @@ func init() {
19891989

19901990
// computer set-cursor
19911991
computerSetCursor := &cobra.Command{Use: "set-cursor <id|persistent-id>", Short: "Hide or show the cursor", Args: cobra.ExactArgs(1), RunE: runBrowsersComputerSetCursor}
1992-
computerSetCursor.Flags().Bool("hidden", false, "Whether to hide the cursor (true) or show it (false)")
1992+
computerSetCursor.Flags().String("hidden", "", "Whether to hide the cursor: true or false")
19931993
_ = computerSetCursor.MarkFlagRequired("hidden")
19941994

19951995
computerRoot.AddCommand(computerClick, computerMove, computerScreenshot, computerType, computerPressKey, computerScroll, computerDrag, computerSetCursor)
@@ -2502,7 +2502,19 @@ func runBrowsersComputerDragMouse(cmd *cobra.Command, args []string) error {
25022502
func runBrowsersComputerSetCursor(cmd *cobra.Command, args []string) error {
25032503
client := getKernelClient(cmd)
25042504
svc := client.Browsers
2505-
hidden, _ := cmd.Flags().GetBool("hidden")
2505+
hiddenStr, _ := cmd.Flags().GetString("hidden")
2506+
2507+
var hidden bool
2508+
switch strings.ToLower(hiddenStr) {
2509+
case "true", "1", "yes":
2510+
hidden = true
2511+
case "false", "0", "no":
2512+
hidden = false
2513+
default:
2514+
pterm.Error.Printf("Invalid value for --hidden: %s (expected true or false)\n", hiddenStr)
2515+
return nil
2516+
}
2517+
25062518
b := BrowsersCmd{browsers: &svc, computer: &svc.Computer}
25072519
return b.ComputerSetCursor(cmd.Context(), BrowsersComputerSetCursorInput{Identifier: args[0], Hidden: hidden})
25082520
}

0 commit comments

Comments
 (0)