Skip to content

Protect commands from using the wrong options #106

@kumar303

Description

@kumar303

We have command handlers like:

export function build({sourceDir}) {
  // work with sourceDir...
}

which rely on the main program from parsing --source-dir and passing it like build({sourceDir: ...}).

I would like to find a way to guarantee that command handlers are declaring only the available option arguments. One solution is to execute unnecessary code such as the main program code for every unit test of a function. I'd like to avoid that if possible since it could introduce slowness (maybe it's not so slow?).

I thought I could do this with Flow and did so in #39 but as of #105 it is becoming difficult to maintain so I removed it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions