Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul CLI #114

Closed
Aloso opened this issue Nov 26, 2024 · 1 comment
Closed

Overhaul CLI #114

Aloso opened this issue Nov 26, 2024 · 1 comment
Assignees
Labels
C-tests Related to unit testing capabilities C-tooling Tools such as IDE integrations, formatters, linters, etc. enhancement New feature or request
Milestone

Comments

@Aloso
Copy link
Member

Aloso commented Nov 26, 2024

Is your feature request related to a problem? Please describe.

The CLI interface is cumbersome to work with:

  • The --test <ENGINE> is weird. It is unexpected that it takes an argument, and the engine (which would be more intuitive as an --engine argument) might be needed for other commands as well

Describe the solution you'd like

I realized that we can add subcommands backwards-compatibly (as long as their names are no valid Pomsky expressions, so pomsky test is fine).

We add a test subcommand and deprecate the --test flag. The engine is specified with the --engine/-e argument instead.

The --path argument accepts a directory when in the test subcommand. Ideally, all Pomsky files can be compiled and tested with a simple invocation:

pomsky test -e pcre2     # assumes --path .

Note that the flavor or the engine needs to be specified. It's not great to have PCRE as the default flavor for testing.

Other possible subcommands are:

  • pomsky check - analogous to pomsky test, but it only compiles, without running tests
  • pomsky eval - compile and test a regular expression in a REPL. pomsky eval --regex can be used as regex-test replacement.
@Aloso Aloso added enhancement New feature or request C-tooling Tools such as IDE integrations, formatters, linters, etc. C-tests Related to unit testing capabilities labels Nov 26, 2024
@Aloso Aloso added this to the v0.12 milestone Nov 30, 2024
@Aloso Aloso self-assigned this Dec 6, 2024
@Aloso
Copy link
Member Author

Aloso commented Dec 12, 2024

The test command is working (including directory support), but the code needs a lot of cleanup.

@Aloso Aloso closed this as completed Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tests Related to unit testing capabilities C-tooling Tools such as IDE integrations, formatters, linters, etc. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant