Skip to content

feat: Add --version and --help flags to the CLI #1

@ioncakephper

Description

@ioncakephper

Is your feature request related to a problem?

The cli-validate executable is a great tool, but it's missing two standard and essential flags that all
command-line tools should have:

  • A --version (or -v) flag to print the installed version of the package.
  • A --help (or -h) flag to print a basic usage message.

Implementing these will improve the tool's usability and align it with user expectations.

Describe the solution you'd like

Tasks:

  1. Modify the bin/cli-validate.js file.
  2. Before any validation logic, check process.argv for the presence of --version, -v, --help, or -h.
  3. If --version or -v is found, read the version from package.json and print it to the console, then exit.
  4. If --help or -h is found, print a simple usage message (e.g., Usage: cli-validate ) and exit.
  5. Ensure that if no flags are present, the existing validation logic runs as expected.

Describe alternatives you've considered

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliassociated with a CLIenhancementNew feature or requestgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions