mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-02 18:13:39 +00:00
docs(cli): describe the typed value and either/or checks (#7071)
Name what typed values made a usage error: a value out of range (--quality 0), malformed --new or --params JSON, <FILE> together with --new, and --control-token together with --control-token-file. A path that is not valid Unicode now reaches the command: convert takes it, info, run and batch fail through the automation layer (exit 1), and droplet, which takes text, refuses it as a usage error. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -63,7 +63,7 @@ layers because that would lose their group's blending semantics.
|
||||
|
||||
Paths supplied to the current CLI are ordinary operating-system paths. The CLI does not restrict them to a workspace root. Batch output creates the requested output directory, and save operations may create parent directories. `batch` refuses an output directory that is its input directory (the results would replace the originals) unless `--in-place` is given. Run untrusted action files only in an appropriately isolated account or environment.
|
||||
|
||||
CLI parsing reports malformed flags and JSON as errors. A flag the subcommand doesn't take (a typo such as `--fromat`) and a flag given twice (only `--cmd` and `--params` may repeat) are usage errors (exit status 2), rather than being ignored. A value flag never takes the next flag as its value, so a value starting with `-` is written with `=` (`--out=-image.png`) or as `./-image.png`; negative numbers such as `--filter -1` still work. `photocraft-cli --version` (or `-V`) prints the version; there is no `version` subcommand.
|
||||
CLI parsing checks the flags and their values before any work starts. A flag the subcommand doesn't take (a typo such as `--fromat`), a flag given twice (only `--cmd` and `--params` may repeat), a value out of range (`--quality 0`), malformed `--new` or `--params` JSON, `<FILE>` together with `--new`, and `--control-token` together with `--control-token-file` are all usage errors (exit status 2), rather than being ignored or failing later. A value flag never takes the next flag as its value, so a value starting with `-` is written with `=` (`--out=-image.png`) or as `./-image.png`; negative numbers such as `--filter -1` still work. A path that is not valid Unicode reaches the command instead of being a usage error: `convert` reads and writes it, while `info`, `run` and `batch` open files through the automation layer, which still needs UTF-8 paths and fails with exit status 1 (`droplet` takes its arguments as text, so it refuses such a path as a usage error). `photocraft-cli --version` (or `-V`) prints the version; there is no `version` subcommand.
|
||||
|
||||
`mcp` and `serve` reject positional arguments, empty values and options for the wrong mode before
|
||||
starting a server. Explicit control-token flags require `mcp --bridge` or `serve --port`. Configure
|
||||
|
||||
Reference in New Issue
Block a user