Crates.io | xurl |
lib.rs | xurl |
version | 0.1.0 |
source | src |
created_at | 2021-06-15 10:55:01.057346 |
updated_at | 2021-06-15 10:55:01.057346 |
description | A command-line utility to manipulate urls |
homepage | |
repository | https://https://github.com/squioc/xurl |
max_upload_size | |
id | 410339 |
size | 20,077 |
A little tool to manipulate urls.
To build the binary just:
cargo build
To install Xurl, type:
cargo install xurl
Xurl offer severals commands:
The dissect
command splits and prints the different parts of the url.
These parts are:
The scheme
For urls with authentication information, the username and the password
The host
The port
The path to the document
The query string
The fragment
$ xurl https://username:password@github.com/squioc/xurl?token=1234#Dissect
scheme: https
username: username
password: password
host: github.com
port: 443
path: /squioc/xurl
query: token=1234
fragment: Dissect
The join
command joins an url and a new path together.
$ xurl join https://github.com/squioc/xurl /rust-lang/rust
https://github.com/rust-lang/rust
The encode
command applies the percent-encoding on the url
$ xurl encode https://github.com/squioc/xurl
https%3A%2F%2Fgithub.com%2Fsquioc%2Fxurl
The decode
command reverses the percent-encoding applyied on an url
$ xurl encode https%3A%2F%2Fgithub.com%2Fsquioc%2Fxurl
https://github.com/squioc/xurl
The idna-encode
command applies the punycode translation on an internationalized domain name.
$ xurl idna-encode https://lafierté-bernard.ça/
https://xn--lafiert-bernard-hnb.xn--a-5fa/
The idna-decode
command reverses the punycode translation applied on an internationalized domain name.
$ xurl idna-encode https://xn--lafiert-bernard-hnb.xn--a-5fa/
https://lafierté-bernard.ça/