puri
("parse uri") is a robust commandline utility that reads and extracts uri components. It processes URLs
with and without schemes.
- bugfix for url withouth proper paths
- bugfix for url paths containing domains
- added simple path parsing that makes this more intuitive over standard library interpretation
brew tap simonmittag/cli &&
brew install puri &&
puri
git clone https://github.com/simonmittag/puri && cd puri &&
go install github.com/simonmittag/puri/cmd/puri &&
puri
~ λ puri
puri[v0.1.9]
Usage: puri [-s]|[-o]|[-r]|[-p]|[-q name]|[-h]|[-v] scheme://host:port#a?k=v
-h print usage instructions
-o extract host
-p extract path
-q string
extract query param
-r extract port
-s extract scheme
-v print puri version
Get URI path without scheme specified
λ puri -p bar.com/foo?k=foo
/foo
Get URI host without scheme specified
λ puri -o bar.com?k=foo
bar.com
Get URI query param
λ puri -q k https://www.bar.com?k=foo
foo
Get URI path (includes anchor)
λ puri -p https://www.foo.com/q#bar?k=v
/q#bar
The puri team welcomes all contributors. Everyone interacting with the project's codebase, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct