Преглед изворни кода

correct the README about an effect index, and the usage line that names it

`mode` was dropped in cffc9dd, which updated AGENTS.md, the skill file and the
tests but left README.md alone. The CLI table still listed it, two examples
still invoked it, and one of them showed output the command stopped printing
when the raw index was folded into `effect`.

The row is deleted rather than rewritten, because `effect` is what takes an
index now, and everything the row said about read-back and clamping is already
true of `effect <index>`. Its clamping sentence was the only place README says
the keyboard clamps an index above the top it takes, so it moves onto the
`effect` row instead of being lost: one place describes the raw-index form
rather than two, of which one named a command that no longer exists.

The usage line said `[name]`. A keyboard holds numbers and an ID is the one
thing it always has, so it claimed a narrower command than the one built, and
`effect 300` is refused with a range error rather than looked up as a name.
Paul-Dieter Klumpp пре 1 недеља
родитељ
комит
abfe3b7bfd
2 измењених фајлова са 6 додато и 7 уклоњено
  1. 5 6
      README.md
  2. 1 1
      cmd/qmk-rgb-tool/effect.go

+ 5 - 6
README.md

@@ -134,8 +134,8 @@ into the prompt, which is worse than an empty list.
 ./qmk-rgb-tool speed 2
 ./qmk-rgb-tool color 00ff00
 ./qmk-rgb-tool color hsv:85,255,255
-# Raw mode IDs are zone-specific; ID 17 is Backlight-only
-./qmk-rgb-tool mode 17 --zone backlight
+# A raw effect index is zone-specific; ID 17 is Backlight-only
+./qmk-rgb-tool effect 17 --zone backlight
 ./qmk-rgb-tool enable
 ./qmk-rgb-tool disable
 ./qmk-rgb-tool info
@@ -299,8 +299,8 @@ above 46 down to it. The definition file names 46 of them, ending at `riverflow`
 so **ID 46 has no name and the tool does not invent one**:
 
 ```
-$ qmk-rgb-tool mode 46 --zone backlight
-Mode set to index 46
+$ qmk-rgb-tool effect 46 --zone backlight
+Effect set to index 46
 $ qmk-rgb-tool info
   Backlight    on   unknown                      brightness 255  speed 127  color hsv:0,255
 ```
@@ -729,7 +729,7 @@ board", and that file is gone, so the field would have been unanswerable:
 | `qmk-rgb-tool enable`                 | Enable selected lighting zones            |
 | `qmk-rgb-tool disable`                | Disable selected lighting zones           |
 | `qmk-rgb-tool info`                   | Show per-zone RGB state                   |
-| `qmk-rgb-tool effect <name>`          | Set a zone-aware effect by name, verified by read-back |
+| `qmk-rgb-tool effect <name\|index>`   | Set an effect by name, or a raw effect index 0–255, verified by read-back; a board that does not implement the index clamps it to the highest it does |
 | `qmk-rgb-tool effect`                 | With no argument, list every effect per channel |
 | `qmk-rgb-tool effect --list`          | The same list, as a flag                   |
 | `qmk-rgb-tool definition fetch`       | Download the VIA definition for the connected keyboard |
@@ -739,7 +739,6 @@ board", and that file is gone, so the field would have been unanswerable:
 | `qmk-rgb-tool color <hex>`            | Set color (e.g. `ff0000`) on selected zones |
 | `qmk-rgb-tool color rgb:<hex>`        | The same hex color, written out |
 | `qmk-rgb-tool color hsv:<h>,<s>,<v>`  | Set hue and saturation (0–255) and write `v` to the brightness of the same zones |
-| `qmk-rgb-tool mode <index>`           | Set a raw zone-specific effect ID, verified by read-back; a board that does not implement the index clamps it to the highest it does |
 | `qmk-rgb-tool --zone <channel> ...`   | Target one channel: `backlight`, `rgblight`, `rgb_matrix`, `audio` or `led_matrix`, or the name the board's definition gives it |
 | `qmk-rgb-tool --device <n> ...`      | Target keyboard by number (see `keyboard info`) |
 | `qmk-rgb-tool --definition <path>`  | Read effect names from this VIA definition file instead of the one in the data directory; applies to every command that resolves names, and a file for another board is refused |

+ 1 - 1
cmd/qmk-rgb-tool/effect.go

@@ -22,7 +22,7 @@ func resolveEffectTargets(catalog *intrgb.Catalog, name string, channels []via.C
 
 func NewEffectCmd() *cobra.Command {
 	cmd := &cobra.Command{
-		Use:   "effect [name]",
+		Use:   "effect [name|index]",
 		Short: "Set or list RGB effects",
 		Long: "Set the RGB lighting effect on the connected keyboard. Without an argument, lists all effects.\n" +
 			"Effect names come from a per-board catalog; a keyboard without one has no names\n" +