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

feat(run-tests-zkasm.js): use yargs to build CLI #226

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

mooori
Copy link

@mooori mooori commented Feb 21, 2024

Uses yargs to handle command line arguments and build a CLI. No changes in behavior.

It is now possible to show docs with node ./run-tests-zkasm.js --help which prints:

run-tests-zkasm.js <path> [outfile]

the default command runs zkASM tests

Positionals:
  path     The zkASM file to run or a directory to search for zkASM files.
                                                                        [string]
  outfile  If provided, results are written to this file. Otherwise they are
           printed to stdout.                                           [string]

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

Motivation

  • Make usage of the script easier, for example when running it manually during development.
  • Facilitate handling of command line options that will be required for benchmarking.
    • Without a library like yargs handling options in addition to multiple positional arguments would become messy.

@mooori mooori marked this pull request as ready for review February 21, 2024 12:37
Copy link

@aborg-dev aborg-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@mooori mooori added this pull request to the merge queue Feb 21, 2024
Merged via the queue into near:main with commit 932468c Feb 21, 2024
20 checks passed
@mooori mooori deleted the yargs-setup branch February 21, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants