elasticio / elasticio-cli

Command-line interface for elastic.io components
2 stars 1 forks source link

The CLI should have a hard exit when a command line argument is provided but is not valid #39

Closed jhorbulyk closed 4 years ago

jhorbulyk commented 4 years ago

Steps to Reproduce

  1. Clone the petstore component.
  2. Create a test/fixture.json file with a template fixture:
    {
    "fixtures": {
    "successfulFixture": {
      "cfg": {},
      "msg": {
        "body": {}
      }
    },
    "failFixture": {
      "cfg": {},
      "msg": {
        "body": {}
      }
    }
    }
    }
  3. Run the CLI tool while referencing an invalid fixture/action/function. E.g.
    • elasticio cmp:process -a createPet -x someInvalidFixture
    • elasticio cmp:process -a someInvalidAction -x successfulFixture
    • elasticio cmp:exec -a createPet -x successfulFixture -f someInvalidFunction

Current Behavior

Currently, a warning is printed and then the execution falls back to prompt the user for the invalid input.

Desired Behavior

The program should print an error and exit with a non-zero exit code.