From d5c623e9dd64458ea737a6b87e9cd8826f4de185 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 27 Aug 2024 17:13:45 +0200 Subject: [PATCH 1/2] trurl.md: apply curl language rules hostname, not host name username, not user name etc --- trurl.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/trurl.md b/trurl.md index 5b17f821..0d41c840 100644 --- a/trurl.md +++ b/trurl.md @@ -72,8 +72,8 @@ provides a best-effort to convert the provided string into a valid URL. ## --as-idn -Converts a punycode ASCII host name to its original International Domain Name -in Unicode. If the host name is not using punycode then the original host name +Converts a punycode ASCII hostname to its original International Domain Name +in Unicode. If the hostname is not using punycode then the original hostname is used. ## --curl @@ -92,9 +92,9 @@ Since, by default, trurl removes default port numbers from URLs with a known scheme, this option is pretty much ignored unless one of *--get*, *--json*, and *--keep-port* is not also specified. -## -f, --url-file [file name] +## -f, --url-file [filename] -Read URLs to work on from the given file. Use the file name `-` (a single +Read URLs to work on from the given file. Use the filename `-` (a single minus) to tell trurl to read the URLs from stdin. Each line needs to be a single valid URL. trurl removes one carriage return @@ -144,11 +144,11 @@ the port is not explicitly specified in the URL, the scheme's default port is output if it is known. If **puny:** is specified, like `{puny:url}` or `{puny:host}`, the punycoded -version of the host name is used in the output. This option is mutually +version of the hostname is used in the output. This option is mutually exclusive with **idn:**. If **idn:** is specified like `{idn:url}` or `{idn:host}`, the International -Domain Name version of the host name is used in the output if it is provided +Domain Name version of the hostname is used in the output if it is provided as a correctly encoded punycode version. This option is mutually exclusive with **puny:**. @@ -217,8 +217,8 @@ are treated as invalid URLs. ## --punycode -Uses the punycode version of the host name, which is how International Domain -Names are converted into plain ASCII. If the host name is not using IDN, the +Uses the punycode version of the hostname, which is how International Domain +Names are converted into plain ASCII. If the hostname is not using IDN, the regular ASCII name is used. ## --query-separator [what] @@ -243,7 +243,7 @@ base URL, so, if no base URL is specified, no redirection is performed. Replaces a URL query. data can either take the form of a single value, or as a key/value pair in the -shape *foo=bar*. If replace is called on an item that isn't in the list of +shape *foo=bar*. If replace is called on an item that is not in the list of queries trurl ignores that item. trurl URL encodes both sides of the `=` character in the given input data @@ -338,7 +338,7 @@ present in the URL. The parts are URL decoded unless *--urlencode* is used. The URL scheme. ## parts.user -The user name. +The username. ## parts.password The password. @@ -348,9 +348,9 @@ The options. Note that only a few URL schemes support the "options" component. ## parts.host -The and normalized host name. It might be a UTF-8 name if an IDN name was used. +The and normalized hostname. It might be a UTF-8 name if an IDN name was used. It can also be a normalized IPv4 or IPv6 address. An IPv6 address always starts -with a bracket (**[**) - and no other host names can contain such a symbol. If +with a bracket (**[**) - and no other hostnames can contain such a symbol. If *--punycode* is used, the punycode version of the host is outputted instead. ## parts.port @@ -386,7 +386,7 @@ It is only present if the URL has a query. # EXAMPLES -## Replace the host name of a URL +## Replace the hostname of a URL ~~~ $ trurl --url https://curl.se --set host=example.com From eadd829c4a0e9cccc2b44959a04a006b9ede4ce1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 27 Aug 2024 17:17:55 +0200 Subject: [PATCH 2/2] fixup edit a mistake --- trurl.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trurl.md b/trurl.md index 0d41c840..d8d288bf 100644 --- a/trurl.md +++ b/trurl.md @@ -348,8 +348,8 @@ The options. Note that only a few URL schemes support the "options" component. ## parts.host -The and normalized hostname. It might be a UTF-8 name if an IDN name was used. -It can also be a normalized IPv4 or IPv6 address. An IPv6 address always starts +The normalized hostname. It might be a UTF-8 name if an IDN name was used. It +can also be a normalized IPv4 or IPv6 address. An IPv6 address always starts with a bracket (**[**) - and no other hostnames can contain such a symbol. If *--punycode* is used, the punycode version of the host is outputted instead.