mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
CLIs can now use this for implicit validation for options that take a file path or - to signal "print to stdout", like so: (defcli! (doom command) ((outfile ("--out" (file stdout)))) (if (equal outfile "-") (print! "output") (with-temp-file outfile (insert "output")))) If OUTFILE is not an existing file path or a -, you'll see an this helpful error: Error: -o/--file received invalid value "FOO" Validation errors: - Must be a dash to signal stdout. - File does not exist. See 'doom h[elp] make codeowners' or 'doom make codeowners {-?,--help}' for documentation.