unity-builder icon indicating copy to clipboard operation
unity-builder copied to clipboard

Consolidate input, query override and cli options

Open frostebite opened this issue 2 years ago • 0 comments

Cli.query is very abstract in naming.

Would it make sense to use a common options approach where you have overrides that are passed in and then there are no "alternative keys"?

Furthermore, I'd argue that even something like getOption would be quite abstract still, and far away from the domain. Abstract code is both difficult to understand and maintain.

An example that could be a bit closer to the domain could look like the following:

Let's assume key that's passed in would be runner

private get isUsingGitHubRunner() {
  return this.options.runner === 'github'
}

Subsequent code becomes much easier to read:

if (this.isUsingGitHubRunner) {
  // something specific to this option
}

Originally posted by @webbertakken in https://github.com/game-ci/unity-builder/pull/353#discussion_r846814761

frostebite avatar Apr 10 '22 21:04 frostebite