quak files takes the collection ID as an optional argument #215

Merged
clawbot merged 1 commits from fix/211-positional-files into next 2026-10-18 20:17:11 +02:00
Collaborator

Builds #211 as planned in #211 (comment).

  • quak files [collectionID] [--json]: the collection ID is an optional argument, and the --collection option is removed. files was the only command with a mandatory option; get, get-thumb, backup and backup-metadata already take theirs positionally.
  • With a collection ID, files lists that collection's files. Without one, it lists every file in the account, collection by collection, each file once. The library keeps a record of a file for each collection that holds it, and only the first collection's record is listed, so in --json a file's collectionID is the first collection that holds it.
  • The listing is the fresh read freshFiles in src/cli-read.ts, whose collection ID is now optional. filesCommand in src/cli-commands.ts takes the ID as its second argument, as getCommand takes its file ID. The refresh still counts its progress on stderr, except with --json; stdout holds only the listing.
  • --help text in bin/quak.ts, README ("Getting Started", "CLI surface", the ID paragraph) and TODO.md updated.
  • Tests: files with no argument on an account with one file in two albums, printed once in text and in --json; files with an ID; a bad ID; and the command line accepting files with and without an ID.

Reading taken (from the plan): a file in several collections is listed once, not once per collection.
Judgement call: the README says "collection by collection" and names no order of collections, since the order the library keeps them in is not promised to match what quak collections prints.

Model: opus-5-5

Builds https://git.eeqj.de/sneak/quak/issues/211 as planned in https://git.eeqj.de/sneak/quak/issues/211#issuecomment-145569. - `quak files [collectionID] [--json]`: the collection ID is an optional argument, and the `--collection` option is removed. `files` was the only command with a mandatory option; `get`, `get-thumb`, `backup` and `backup-metadata` already take theirs positionally. - With a collection ID, `files` lists that collection's files. Without one, it lists every file in the account, collection by collection, each file once. The library keeps a record of a file for each collection that holds it, and only the first collection's record is listed, so in `--json` a file's `collectionID` is the first collection that holds it. - The listing is the fresh read `freshFiles` in `src/cli-read.ts`, whose collection ID is now optional. `filesCommand` in `src/cli-commands.ts` takes the ID as its second argument, as `getCommand` takes its file ID. The refresh still counts its progress on stderr, except with `--json`; stdout holds only the listing. - `--help` text in `bin/quak.ts`, README ("Getting Started", "CLI surface", the ID paragraph) and `TODO.md` updated. - Tests: `files` with no argument on an account with one file in two albums, printed once in text and in `--json`; `files` with an ID; a bad ID; and the command line accepting `files` with and without an ID. Reading taken (from the plan): a file in several collections is listed once, not once per collection. Judgement call: the README says "collection by collection" and names no order of collections, since the order the library keeps them in is not promised to match what `quak collections` prints. Model: opus-5-5
clawbot added the needs-review label 2026-10-18 19:40:22 +02:00
clawbot self-assigned this 2026-10-18 19:40:26 +02:00
Author
Collaborator

Review passed.
Model: opus-5-5

Review passed. Model: opus-5-5
clawbot added needs-rebase and removed needs-review labels 2026-10-18 20:06:01 +02:00
clawbot added 1 commit 2026-10-18 20:10:49 +02:00
Mandatory arguments are positional, so `quak files` takes the collection
ID as an optional argument and the `--collection` option is removed.
With a collection ID it lists that collection's files. Without one it
lists every file in the account, collection by collection, each file
once: the library keeps a record of a file for each collection that
holds it, and only the first collection's record is listed, so that
collection is its `collectionID` in `--json`. The `--help` text, the
README and `TODO.md` say so.

Model: opus-5-5
clawbot force-pushed fix/211-positional-files from 35bd45a575 to c34e05cfe0 2026-10-18 20:10:49 +02:00 Compare
Author
Collaborator

Rebased onto next. The conflict was in TODO.md: both this change and the fix for #205 added an entry at the top of Completed Steps. Both entries are kept, and the Next Step no longer lists #211 as open.

Model: opus-5-5

Rebased onto `next`. The conflict was in `TODO.md`: both this change and the fix for https://git.eeqj.de/sneak/quak/issues/205 added an entry at the top of Completed Steps. Both entries are kept, and the Next Step no longer lists https://git.eeqj.de/sneak/quak/issues/211 as open. Model: opus-5-5
clawbot merged commit 92e0c6c791 into next 2026-10-18 20:17:11 +02:00
clawbot deleted branch fix/211-positional-files 2026-10-18 20:17:11 +02:00
Sign in to join this conversation.