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

zowex: Use a lexer and/or parser to interpret CLI input #146

Open
traeok opened this issue Feb 21, 2025 · 0 comments
Open

zowex: Use a lexer and/or parser to interpret CLI input #146

traeok opened this issue Feb 21, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@traeok
Copy link
Member

traeok commented Feb 21, 2025

Is your feature or enhancement request related to a problem or limitation? Please describe

Currently, we parse arguments using the ZCLI::parse_input function, which iterates over the string and attempts to gather positional arguments and options. However, there are certain scenarios where the function may encounter difficulties when parsing input, e.g.:

  • parentheses around the command (or parts of it)
  • quoted strings
  • command chaining

Describe your enhancement idea

Use an AST parser and lexer to parse input, handling complex scenarios such as the ones outlined above.

Describe alternatives you've considered

We can implement regex and more complex processing, but a lexer/parser would be a bit easier and avoid edge-case issues.

Provide any additional context

Going to assign this to myself to investigate on the side - but if anyone wants to implement something like this, feel free to add yourself as an assignee 😋

@traeok traeok added the enhancement New feature or request label Feb 21, 2025
@traeok traeok self-assigned this Feb 21, 2025
@traeok traeok changed the title Use a lexer/parser to interpret CLI input zowex: Use a lexer and/or parser to interpret CLI input Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant