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

Support --from-entry option #2500

Closed
1 task
hsanson opened this issue Mar 10, 2024 · 4 comments · Fixed by #2556
Closed
1 task

Support --from-entry option #2500

hsanson opened this issue Mar 10, 2024 · 4 comments · Fixed by #2556
Labels
enhancement New feature or request
Milestone

Comments

@hsanson
Copy link

hsanson commented Mar 10, 2024

Problem to solve

Would be nice to have a --from-entry option similar to --to-entry to run sections of the hurl file.

Proposal

Add --from-entry option that accepts an entry index and runs the hurl file starting from that entry up to --to-entry if defined or to end of file if not.

Additional context and resources

Trying to improve hurl.nvim plugin capability to run visually selected sections of a Hurl file.

Tasks to complete

  • ...
@hsanson hsanson added the enhancement New feature or request label Mar 10, 2024
@jcamiel
Copy link
Collaborator

jcamiel commented Mar 10, 2024

Hi @hsanson

It makes sens supporting --from-entry (and maybe --entry to execute only one entry). Something I'll be happy to have feedback is whether we should support also equivalent "line" options (see #1820).

Without IDE support, I find it easier to see on which line is a specific entry (instead of counting entry). We need to define what's happening when the specified line is not an entry obviously.

But in the context of an editor, we can begin by implementing "--entry" options first.

@hsanson
Copy link
Author

hsanson commented Mar 12, 2024

The logic to determine entries from a line position is not trivial so supporting "from_line", "to_line", and "at_line" options would make it easier to integrate with other editor's and IDE's.

If I had to implement this I would:

  1. Make from_line default to start of hurl file and to_line default to end of file.
  2. When executing a hurl file, find all entries contained within the from_line to to_line including partially contained entries at the edges and execute all these entries.
  3. When using at_line set both to_line and from_line equal to the provided at_line value and perform same logic to fined entries contained in the range of lines and execute them.

@jcamiel
Copy link
Collaborator

jcamiel commented Mar 12, 2024

Very clear, thanks a lot!

@jcamiel
Copy link
Collaborator

jcamiel commented Mar 19, 2024

Hi @hsanson this is merged by #2556 for Hurl 4.3.0. Thanks for the issue!

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

Successfully merging a pull request may close this issue.

2 participants