trurl
trurl copied to clipboard
trurl is a command line tool for URL parsing and manipulation.
I learned about `trurl` today and gave it go. You can get the value of a query parameter through `--get "{query:$NAME}"`. It's also possible to add multiple query parameters with...
While `--get "{query:$NAME}"` is valid syntax, `--set "query:$NAME=$VALUE"` is not. This is somewhat unintuitive. Instead, you have to use `--force-replace "$NAME=$VALUE"` which does the same thing as `--set` for all...
Where something like: `trurl -g {path:2}` would get the 2nd slash separated element of a URL path. The slash separated elements can also take a form of array in the...
For now the default scheme seems to be coming from libcurl, which is typically 'http'. It could be useful to override it to something else, such as 'https' to get...
Hey folks, the xz dilemma made me think about how we can strengthen curl and its ecosystem and what role sandboxing plays. Reading @bagder's post https://daniel.haxx.se/blog/2024/04/10/verified-curl/ I was missing thoughts...
the current output JSON feature ``` $ trurl "https://fake.host/hello#frag" --set user=::moo:: --json [ { "url": "https://%3a%3amoo%3a%[email protected]/hello#frag", "parts": { "scheme": "https", "user": "::moo::", "host": "fake.host", "path": "/hello", "fragment": "frag" } }...
Having to specify `-f -` when using trurl in a pipeline is a little clunky. IMO if no URLs are provided on the command line, trurl should behave as if...
`scheme://host/path/#` and `scheme://host/path/` are different and so is `scheme://host/path/?`. It would be nice if `--get` lets you differentiate them and and `--set` lets you produce them.
Components with control characters don't appear in `--json` output, and non-urlencoded `--get` fails
```console $ ./trurl 'http://example.org/%18' --json | jq -c . [{"url":"http://example.org/%18","parts":{"scheme":"http","host":"example.org"}}] $ ./trurl 'http://example.org/%18' --urlencode --json | jq -c . [{"url":"http://example.org/%18","parts":{"scheme":"http","host":"example.org","path":"/%18"}}] ``` ```console $ ./trurl 'http://example.org/%18' -g {path} trurl note: URL...
it would be nice to have binary releases on github (including windows). for golang tools it is quite common that they provide multiplatform builds on github.