doomemacs/lisp
Henrik Lissner d53e08767d
feat(cli): add stdout implicit arg type
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.
2022-08-07 19:43:27 +02:00
..
cli refactor: replace doom-enlist with ensure-list 2022-08-07 19:43:13 +02:00
lib refactor: replace doom-enlist with ensure-list 2022-08-07 19:43:13 +02:00
doom-cli-lib.el feat(cli): add stdout implicit arg type 2022-08-07 19:43:27 +02:00
doom-cli.el refactor!: restructure Doom core 2022-07-30 22:41:13 +02:00
doom-editor.el merge: rewrite-docs 2022-08-03 03:27:50 +02:00
doom-keybinds.el refactor: replace doom-enlist with ensure-list 2022-08-07 19:43:13 +02:00
doom-lib.el refactor: replace doom-enlist with ensure-list 2022-08-07 19:43:13 +02:00
doom-modules.el refactor!: restructure Doom core 2022-07-30 22:41:13 +02:00
doom-packages.el refactor: replace doom-enlist with ensure-list 2022-08-07 19:43:13 +02:00
doom-projects.el refactor!: restructure Doom core 2022-07-30 22:41:13 +02:00
doom-start.el refactor!: restructure Doom core 2022-07-30 22:41:13 +02:00
doom-ui.el refactor!: restructure Doom core 2022-07-30 22:41:13 +02:00
doom.el release(modules): 22.08.0-dev 2022-08-04 01:29:37 +02:00
packages.el refactor!: restructure Doom core 2022-07-30 22:41:13 +02:00