quak files takes the collection ID as an optional argument (closes #211)
check / check (push) Canceled after 0s

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
This commit was merged in pull request #215.
This commit is contained in:
2026-10-18 20:17:10 +02:00
parent 66e3ac77e8
commit 92e0c6c791
9 changed files with 182 additions and 69 deletions
+9 -3
View File
@@ -269,15 +269,21 @@ export const collectionsCommand = async (
}
};
// Lists the files of the collection `collectionIDStr` names, or without it every
// file in the account, each once (issue #211).
export const filesCommand = async (
ctx: CliContext,
opts: { collection: string; json?: boolean },
collectionIDStr: string | undefined,
opts: { json?: boolean },
): Promise<number> => {
await init();
const client = requireSession(ctx);
if (!client) return 3;
const collectionID = parseID(ctx, "collection", opts.collection);
if (collectionID === undefined) return 1;
const collectionID =
collectionIDStr === undefined
? undefined
: parseID(ctx, "collection", collectionIDStr);
if (collectionIDStr !== undefined && collectionID === undefined) return 1;
const lib = await openReadLibrary(ctx, client, opts);
try {