mirror of
https://github.com/doomemacs/doomemacs.git
synced 2025-12-15 23:00:52 -08: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.
|
||
|---|---|---|
| .. | ||
| cli | ||
| lib | ||
| doom-cli-lib.el | ||
| doom-cli.el | ||
| doom-editor.el | ||
| doom-keybinds.el | ||
| doom-lib.el | ||
| doom-modules.el | ||
| doom-packages.el | ||
| doom-projects.el | ||
| doom-start.el | ||
| doom-ui.el | ||
| doom.el | ||
| packages.el | ||