Validates parsed CLI args against a fuz_schema schema.
Handles CLI-specific concerns before validation:
- Validates schema (cached) - returns its conflict issues if aliases conflict
- Expands aliases defined with
meta(entry, {aliases: ['v']}) - Strips alias keys (required for
object schemas, which refuse unknown keys) - Validates with
parse - After validation, syncs
no- prefixed boolean flags with their base keys
A boolean x and no-x given both ways, as by -C --color with C an alias of
no-color, resolve to the side whose key comes later in unparsed_args (argv_parse orders
keys by their last appearance in argv, so the side given last), and the other is set to its
negation. An alias given with its canonical key gives way to it, and of two aliases of one key
the earlier key wins; a key that gives way counts for neither value nor order, so
--color -C -c with c an alias of color resolves to no-color. Only a no-x pair
resolves by order.
Every arg key is an own key of what schema parses, __proto__, constructor, and
toString included, so an object schema refuses them as unknown keys, and an entry
named like an Object.prototype member reads as absent when it isn't given.
Schema analysis is cached per schema (WeakMap) for performance.
No array of the output is one of unparsed_args: those are copied. A with_default
value is the same object on every parse: give an array or object entry its
default with with_default_fn, as _: s.with_default_fn(s.array(s.string), () => []).