curl / trurl

trurl is a command line tool for URL parsing and manipulation.
https://curl.se/trurl/
Other
3.1k stars 99 forks source link

trurl: add "strict:" as prefix to a get component #310

Closed bagder closed 2 months ago

bagder commented 3 months ago

The strict prefix makes trurl immediately exit with an error code if such a get can't be done due to URL decoding problems. By default, such a problem will only make trurl skip that part and silently continue.

Use it like this: --get "{strict:query}"

I also made "url:" a valid prefix, and now we consider the single colon prefix to be a shortcut for url:. The concept of prefixes scale better when we use real words instead of single characters.

Ref: #305

bagder commented 2 months ago

I created this PR because of an issue but I get no more feedback on it. I believe this can still be a decent improvement, that also is not in the way for users who don't want it. Unless someone objects properly I will proceed and merge soon.