| 1234567891011121314151617181920212223242526272829 |
- package main
- import (
- "fmt"
- "github.com/spf13/cobra"
- )
- func NewDisableCmd() *cobra.Command {
- return &cobra.Command{
- Use: "disable",
- Short: "Disable RGB lighting",
- Args: cobra.NoArgs,
- RunE: func(cmd *cobra.Command, args []string) error {
- proto, _, channels, err := openTarget()
- if err != nil {
- return err
- }
- defer proto.Close()
- if err := disableLightingOnChannels(proto, channels); err != nil {
- return fmt.Errorf("disable RGB: %w", err)
- }
- fmt.Fprintln(cmd.OutOrStdout(), "RGB disabled")
- return nil
- },
- }
- }
|