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

tool_writeout: add URL component variables #10853

Closed
wants to merge 1 commit into from

Conversation

bagder
Copy link
Member

@bagder bagder commented Mar 28, 2023

Output specific components from the used URL. The following -w variables are added for this purpose:

url.scheme, url.user, url.password, url.options, url.host, url.port, url.path, url.query, url.fragment, url.zoneid

and for getting the components out of the "effective URL":

urle.scheme, urle.user, urle.password, urle.options, urle.host, urle.port, urle.path, urle.query, urle.fragment, urle.zoneid

Added test 423 and 424 to verify.

@bagder bagder added cmdline tool feature-window A merge of this requires an open feature window labels Mar 28, 2023
@github-actions github-actions bot added the tests label Mar 28, 2023
src/tool_writeout.c Fixed Show fixed Hide fixed
src/tool_writeout.c Fixed Show fixed Hide fixed
@bagder bagder force-pushed the bagder/writeout-url-parts branch 3 times, most recently from a79ff1d to 43e2f54 Compare March 30, 2023 08:24
@bagder bagder removed the feature-window A merge of this requires an open feature window label Mar 30, 2023
Output specific components from the used URL. The following variables
are added for this purpose:

  url.scheme, url.user, url.password, url.options, url.host, url.port,
  url.path, url.query, url.fragment, url.zoneid

Add the following for outputting parts of the "effective URL":

 urle.scheme, urle.user, urle.password, urle.options, urle.host, urle.port,
 urle.path, urle.query, urle.fragment, urle.zoneid

Added test 423 and 424 to verify.

Closes #10853
.TP
.B urle.zoneid
The zoneid part of the effective (last) URL that was fetched. (Added in 8.1.0)
.TP
Copy link
Member

Choose a reason for hiding this comment

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

This could all be combined in .B url and .B url_effective (imo makes more sense than urle) to say something like

.B url
The URL that was fetched. (Added in 7.75.0)

Individual parts of the URL can written using format `url.<part>`. The
part names are: are fragment, host, options, password, path, port,
query, scheme, user, and zoneid. (Added in 8.1.0)

Copy link
Member Author

Choose a reason for hiding this comment

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

It could be written like that but would make them much harder to find and they can't be searchable in their full names. I prefer listing all names the same way.

I went with "urle" instead of "url_effective" simply because the names becomes unwieldy long otherwise. Like url_effective.fragment.

@bagder bagder closed this in 808cb31 Apr 4, 2023
@bagder bagder deleted the bagder/writeout-url-parts branch April 4, 2023 12:43
bch pushed a commit to bch/curl that referenced this pull request Jul 19, 2023
Output specific components from the used URL. The following variables
are added for this purpose:

  url.scheme, url.user, url.password, url.options, url.host, url.port,
  url.path, url.query, url.fragment, url.zoneid

Add the following for outputting parts of the "effective URL":

 urle.scheme, urle.user, urle.password, urle.options, urle.host, urle.port,
 urle.path, urle.query, urle.fragment, urle.zoneid

Added test 423 and 424 to verify.

Closes curl#10853
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants