Visitar URL original
add option --to-entry-line-number <ENTRY_LINE_NUMBER> · Issue #4905 · Orange-OpenSource/hurl · GitHub
Skip to content

add option --to-entry-line-number <ENTRY_LINE_NUMBER> #4905

Open

Description

@wild-man

for more simple integrations It will great if possible to specify the line from which to run the request in the file.

1 ### entry 1
2 POST {{scheme}}://{{host}}{{pref_uri}}/v0/status
3 Content-Type: application/json

5 {"id":1,"method":"Status","params":null}
6
7 ### entry 2
8 POST {{scheme}}://{{host}}{{pref_uri}}/v0/some_url/
9 Content-Type: application/json

11{"id":1,"method":"state","params":null}

so --to-entry-line-number 1-6 run first request
--to-entry-line-number 7-11 run second request

Something like that.

Activity

  1. giorgiovilardo commented on Mar 27, 2026

    @giorgiovilardo
    Contributor

    not a maintainer in any capacity here, just curious:

    given this file req.hurl:

    GET https://httpbin.org/get
    x-foo: foo
    
    DELETE https://httpbin.org/delete
    x-a-delete: true
    
    POST https://httpbin.org/post
    x-a-header: 123
    {"foo": "bar"}
    

    what would the proposed parameters give over sed?

    sed -n "4,5p" req.hurl | hurl for the delete, sed -n "4p; 8,9p" req.hurl | hurl for the delete with the args of the post, and then there are head and tail for when you know it's on top/bottom.

    I guess it's tidier/more ergonomic without the pipe? but with sed you can pick arbitrary lines...

  2. wild-man commented on Mar 28, 2026

    @wild-man
    Author

    As I say this flag will be very useful on integration (in my case with Zed) when you edit file directly and want to exec one request from them. So this not very comfortable to place line numbers to sed especially when you edit with copy paste some big json objects in the query.

    Any way hurl already have very close parameter:
    [--to-entry <ENTRY_NUMBER>] (hurl.dev/docs/manual.html#to-entry)

    For whom is this parameter made then if we can always use SED?

  3. smilingthax commented on Mar 31, 2026

    @smilingthax

    I have a similar experience: When using hurl --test, it might output something like:

    error: Assert status code
        --> -:3388:6
         |
         | GET https://...some...url
    3388 | HTTP 200
         |      ^^^ actual value is <404>
         |
    
    Failure - (201 request(s) in 4524 ms)
    --------------------------------------------------------------------------------
    Executed files:    1
    Executed requests: 201 (43.2/s)
    Succeeded files:   0 (0.0%)
    Failed files:      1 (100.0%)
    Duration:          4650 ms
    

    But 3388 is a line number, not a test number...
    For me, outputting the test number (in addition to the line number) in the assert error would be good enough to rerun the test with --from-entry / --to-entry, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions