Skip to content

Show --help option text when users doesn't provide any arguments #3

@FranjoMindek

Description

@FranjoMindek

Currently we use commander-js for CLI.

We want:

  1. For mode argument to be required and for that to be reflected in types
  2. When user uses run-wasp-app without args, to send the --help option text

Currently that is impossible to do in an ergonomic way in commander-js.

With commander-js we can:

  • Break 1) and make the mode optional, and then handle the undefined state ourslves
  • Tap into configureOutput and outputError inside of it, and then for that specific error message override it with --help option text
  • Disable it's exit handling logic completely and do it ourselves, almost same as above but worse

Because of that we decided to leave its default behavior, which prints error: missing required argument 'mode'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions