Repository navigation
feat(cli): enforce positional argument counts, canonical parser, and --file flag - #138
Merged
udoyechinenyevictoria merged 2 commits intoOct 21, 2026
Conversation
…--file flag - Enforce argument counts: reject positionals for list, require 1 target for validate and run - Use canonical parseScenario and check definition byte limits via stat before reading - Normalize scenario file extensions with extname for case-insensitivity (.json, .yaml, .yml) - Add explicit --file flag for run command with mutual exclusivity against positional targets - Add comprehensive unit test coverage for argument parsing, extensions, and limits Closes Esureorg#50, Esureorg#51, Esureorg#52, Esureorg#53
|
@software321dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@software321dev is attempting to deploy a commit to the Favour Chigozirim's projects Team on Vercel. A member of the Team first needs to authorize it. |
Collaborator
|
resolve conflict please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This PR addresses issues #50, #51, #52, and #53 with the following improvements to
@esure/cli:Enforce Command-Specific Argument Counts (CLI: enforce positional argument counts for each command #50):
liststrictly rejects any positional arguments and displays usage.validaterequires exactly one file path target, rejecting both missing and extra arguments.runrequires exactly one target (either via positional argument or--file), rejecting missing or extraneous arguments.Use Canonical Scenario Parser (CLI: use the canonical scenario parser for local files #51):
parseScenariofrom@esure/backend/src/scenario-loader.js.statenforcesSCENARIO_LIMITS.definitionBytes.Case-Insensitive File Extensions (CLI: accept case-insensitive scenario file extensions #52):
path.extname(filePath).toLowerCase()to normalize file extensions..json,.JSON,.yaml,.YAML,.yml, and any mixed-case variations.dir.json/scenario.yaml) do not influence format detection.Explicit
--fileSelector (CLI: add an explicit --file selector for run targets #53):--file <path>option toesure runto explicitly select a local scenario file without heuristics.--fileand a positional target fails with a descriptive error.Scenario file not found: ...).--helptext to document the--fileflag and usage examples.Testing:
--fileresolution.Closes #50
Closes #51
Closes #52
Closes #53