11 Commits

Author SHA1 Message Date
Mitchell Hashimoto
1739418f6f cli: make the action parser (+foo) generic and reusable 2025-07-09 15:06:24 -07:00
Anund
168dd31367 documentation: consistent format for actions help 2025-01-23 15:58:33 -08:00
Mitchell Hashimoto
c90ed29341 cli: skip argv0 and actions when parsing CLI flags
This fixes a regression from #2454. In that PR, we added an error when
positional arguments are detected. I believe that's correct, but we
were silently relying on the previous behavior in the CLI commands.

This commit changes the CLI commands to use a new argsIterator function
that creates an iterator that skips the first argument (argv0). This is
the same behavior that the config parsing does and now uses this shared
logic.

This also makes it so the argsIterator ignores actions (`+things`)
and we document that we expect those to be handled earlier.
2024-10-18 12:59:16 -07:00
Mitchell Hashimoto
a4e14631ef config: richer diagnostics for errors
Rather than storing a list of errors we now store a list of
"diagnostics." Each diagnostic has a richer set of structured
information, including a message, a key, the location where it occurred.

This lets us show more detailed messages, more human friendly messages, and
also let's us filter by key or location. We don't take advantage of
all of this capability in this initial commit, but we do use every field
for something.
2024-10-18 08:11:11 -07:00
Mitchell Hashimoto
b3e1b2e02a some tweaks 2024-07-22 09:48:23 -07:00
Remi Gelinas
699fce0ee5 docs: add docstrings 2024-07-18 11:03:23 -04:00
Remi Gelinas
0197f6d15e fix: handle recursive config files 2024-07-17 17:27:31 -04:00
Remi Gelinas
a546da0417 feat: print every config error message 2024-07-17 17:03:09 -04:00
Remi Gelinas
368868f712 fix: handle relative paths in CLI 2024-07-17 16:51:16 -04:00
Remi Gelinas
3350e3c848 refactor: move config file loading into loadFile 2024-07-17 15:02:03 -04:00
Remi Gelinas
431c99313c feat(cli): add initial validate-config action 2024-07-17 12:27:12 -04:00