Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finalize command line interface #225

Open
javagl opened this issue Oct 4, 2022 · 1 comment
Open

Finalize command line interface #225

javagl opened this issue Oct 4, 2022 · 1 comment

Comments

@javagl
Copy link
Contributor

javagl commented Oct 4, 2022

The Usage section in the README and the yargs arguments definitions describe the current state of the command line interface (CLI).

This interface has been set up "pragmatically", based on what I thought that it could make sense. It is by no means complete, and should be reviewed from a user- and usability perspective.

What has to be kept in mind is that it will have to be extended. For example, when the "Styling" validation is supposed to be added, the input file could be given as --styleFile (akin to the current --tilesetFile and other input files).

The CLI might also have to be extended significantly, namely when it should include certain configuration parameters for the validator. The configuration parameters still have to be decided upon. The issue #224 lists some possible configuration options.


In general, I think that one thing should be supported in any case - namely, reading the configuration from a file. It should be possible to have all the options for the input and validation process summarized in a config.json that might look roughly like this:

{
    "tilesetsDirectory": "/data/tilesets/",
    "tilesetGlobPattern": "**/tileset.json",
    "validateContentTypes": [ "B3DM", "GLB" ],
    "validateAbsoluteUris": true,
    "ignoredIssueTypes": ["ASSET_VERSION_UNKNOWN", "TEMPLATE_URI_MISSING_VARIABLE_NAME" ]
}

This would allow "freezing" certain configurations, and to mainain them (in a repository, like source code), without having to resort to shell scripts or batch files....

@javagl
Copy link
Contributor Author

javagl commented Dec 13, 2022

There has been some progress for defining the CLI and how to manage the options. The basic approach is described in #224 (comment) . The 1-minute summary is:

There is an option to pass in a config.json at the CLI. This JSON file can contain all command line parameters that could otherwise be passed in directly via the command line. So the command line

npx ts-node src/main.ts --tilesetsDirectory specs/data/tilesets/ --tilesetGlobPattern **/*.json --writeReports

should be equivalent to

npx ts-node src/main.ts --configFile config.json

with config.json being

{
  "tilesetsDirectory": "specs/data/tilesets",
  "tilesetGlobPattern": "**/*.json",
  "writeReports": true
}

This only defines a way how to manage the command line options (reproducably and in a single file).
It does not yet define which options there actually are. So the command line arguments are not "finalized" yet (i.e. there is not yet a "1.0.0" version with stability guarantees). But it is becoming unlikely that there will be significant changes in the existing CLI options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant