mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-12-02 20:20:35 -05:00
`flag(args, "--name")` matched any token, so a value-taking option's operand was taken for an option. With a password of `--out`, `extract --password --out in.pdf --pages 1 --out out.pdf` read `in.pdf` as the output and wrote over the source file. Add `value_of_flag`, which walks the arguments by the command's option spec as `validate_options` and `positional` do, and move `info`, `text`, `combine`, `extract`, `split` and `render` to it. An option left without an operand at the end of the line is now reported instead of being read as absent, and a repeated option's last value is the one used. Fixes #7516