c9acdb7 removes doom.cmd because it was broken in most cases. This adds
doom.ps1; an alternative script for Windows+Powershell users, which
properly initializes the state it needs. Naturally, it requires
Powershell 3+ be installed on your systems, but it can be invoked from
either cmd.exe or PowerShell.exe.
This is the first powershell script I've ever written, so I expect edge
cases (for one, shell commands passed to `exit!` will need to be guarded
against the environment).
This also requires emacs.exe be your $PATH, however, unless you set
$EMACS to its path first. E.g.
$env:EMACS = "C:\Program Files\Emacs\emacs-29.4\bin\emacs.exe"
That said, if you use WSL2, you're still far better off using the bash
script (bin/doom).
Ref: c9acdb72a4
Eventually, I want to autoload some of this stuff, so that users in
interactive sessions can safely load it without side effects (useful
when writing their own CLIs or editing Doom's source).
This was done to purge superfluous files from Doom's project structure
and simplify its entry points. And with early-init.el now acting as
Doom's universal bootstrapper (see c05e615), we don't have enough
bootstrap logic to warrant being its own file.
Also removes the redundant version check, given doom.el is assured to be
loaded before doom-cli, and performs its own check.
Ref: c05e61536e
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.
Now you can specify more than one allowed (implicit) for a CLI option:
(defcli! (doom somecommand) ((foo ("--foo" (file int)))))
This will test FOO to ensure it is either an existing file path or an
integer. If neither is true, you'll see this helpful error:
Error: -o/--file received invalid value "FOO"
Validation errors:
- Not an integer.
- Not a valid path to an existing file.
doom-enlist is now a deprecated alias for ensure-list, which is built
into Emacs 28.1+ and is its drop-in replacement. We've already
backported it for 27.x users in doom-lib (in 4bf4978).
Ref: 4bf49785fd
20d5440 introduced a regression where options would be lost when a CLI
session is restarted. :config literate users, for example, would run
'doom sync -u' only for the -u option to be ignored, because it was
discarded after the literate module restarts the session.
Amend: 20d5440023
BREAKING CHANGE: This restructures the project in preparation for Doom
to be split into two repos. Users that have reconfigured Doom's CLI
stand a good chance of seeing breakage, especially if they've referred
to any core-* feature, e.g.
(after! core-cli-ci ...)
To fix it, simply s/core-/doom-/, i.e.
(after! doom-cli-ci ...)
What this commit specifically changes is:
- Renames all core features from core-* to doom-*
- Moves core/core-* -> lisp/doom-*
- Moves core/autoloads/* -> lisp/lib/*
- Moves core/templates -> templates/
Ref: #4273