Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add filtering param for index.js when used as CLI (w3c#21)
The index of specifications is mostly aimed at being imported in other modules, but using it as a CLI is useful to visualize specs that the index contains. This update adds the ability to pass an identifier argument on the command-line that can either be: - an integer, in which case it gets interpreted as the position of the spec of interest in the list (it can be useful when a JSON schema validation error gets reported as it often just points at a position in the list). - a string, in which case the CLI returns all specs that have a URL, name, shortname or composition level that matches the string. The CLI outputs a formatted spec object if there's only one spec that matches the filter argument, an array of spec objects if there's more than one.
- Loading branch information