The commands that take an ID read it with Number() and accept anything that comes out finite (src/cli-commands.ts):
quak get 0x10 downloads file 16; quak get 1e3 downloads file 1000; quak get "" and quak get " " look up file 0; quak get 1.5 looks up file 1.5. The same holds for get-thumb and files --collection.
quak helper fix-missing-thumbnails --file abc drops abc without a word, fixes nothing and exits 0, so the user believes it worked.
Definition of done
get, get-thumb, files --collection and helper fix-missing-thumbnails --file accept an ID only when it is written as decimal digits and is a safe integer.
Anything else prints one line, Invalid file ID: ARG (or Invalid collection ID: ARG), and exits 1 before any request. For --file, one bad ID fails the whole command and nothing is fixed.
One small function does the check for all four.
Tests for each command: a good ID, and 0x10, 1e3, 1.5, -1, an empty string and abc.
Model: opus-5-5
## Problem
The commands that take an ID read it with `Number()` and accept anything that comes out finite (`src/cli-commands.ts`):
- `quak get 0x10` downloads file 16; `quak get 1e3` downloads file 1000; `quak get ""` and `quak get " "` look up file 0; `quak get 1.5` looks up file 1.5. The same holds for `get-thumb` and `files --collection`.
- `quak helper fix-missing-thumbnails --file abc` drops `abc` without a word, fixes nothing and exits 0, so the user believes it worked.
## Definition of done
- `get`, `get-thumb`, `files --collection` and `helper fix-missing-thumbnails --file` accept an ID only when it is written as decimal digits and is a safe integer.
- Anything else prints one line, `Invalid file ID: ARG` (or `Invalid collection ID: ARG`), and exits 1 before any request. For `--file`, one bad ID fails the whole command and nothing is fixed.
- One small function does the check for all four.
- Tests for each command: a good ID, and `0x10`, `1e3`, `1.5`, `-1`, an empty string and `abc`.
Model: opus-5-5
clawbot
added this to the 1.0.0 milestone 2026-10-14 01:33:14 +02:00
Built in #189: one check in src/cli-commands.ts for all four commands; a bad --file ID now fails the fixer before it opens the library.
Model: opus-5-5
Built in https://git.eeqj.de/sneak/quak/pulls/189: one check in `src/cli-commands.ts` for all four commands; a bad `--file` ID now fails the fixer before it opens the library.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
The commands that take an ID read it with
Number()and accept anything that comes out finite (src/cli-commands.ts):quak get 0x10downloads file 16;quak get 1e3downloads file 1000;quak get ""andquak get " "look up file 0;quak get 1.5looks up file 1.5. The same holds forget-thumbandfiles --collection.quak helper fix-missing-thumbnails --file abcdropsabcwithout a word, fixes nothing and exits 0, so the user believes it worked.Definition of done
get,get-thumb,files --collectionandhelper fix-missing-thumbnails --fileaccept an ID only when it is written as decimal digits and is a safe integer.Invalid file ID: ARG(orInvalid collection ID: ARG), and exits 1 before any request. For--file, one bad ID fails the whole command and nothing is fixed.0x10,1e3,1.5,-1, an empty string andabc.Model: opus-5-5
Built in #189: one check in
src/cli-commands.tsfor all four commands; a bad--fileID now fails the fixer before it opens the library.Model: opus-5-5