Go to file
2020-09-25 18:41:51 +02:00
.github refactoring 2020-09-21 20:24:51 +02:00
cmd/url-parser refactoring 2020-09-21 20:24:51 +02:00
internal/command refactoring 2020-09-21 20:24:51 +02:00
.drone.jsonnet fix naming 2020-09-21 20:29:21 +02:00
.drone.yml fix naming 2020-09-21 20:29:21 +02:00
.gitignore refactoring 2020-09-21 20:24:51 +02:00
CHANGELOG.md refactoring 2020-09-21 20:24:51 +02:00
go.mod refactoring 2020-09-21 20:24:51 +02:00
go.sum refactoring 2020-09-21 20:24:51 +02:00
LICENSE refactoring 2020-09-21 20:24:51 +02:00
README.md fix license badge 2020-09-25 18:41:51 +02:00

url-parser

Build Status Go Report Card Codecov GitHub contributors License: MIT

Inspired by herloct/url-parser, a simple command-line utility for parsing URLs.

Instalation

Prebuild multiarch binaries are availabe for Linux only:

curl -L https://github.com/thegeeklab/url-parser/releases/download/v0.1.0/url-parser-0.1.0-linux-amd64 > /usr/local/bin/url-parser
chmod +x /usr/local/bin/url-parser
url-parser --help

Usage

$ url-parser --help
NAME:
   url-parser - Parse URL and shows the part of it.

USAGE:
   url-parser [global options] command [command options] [arguments...]

VERSION:
   devel

COMMANDS:
   all, a        Get all parts from url
   scheme, s     Get scheme from url
   user, u       Get username from url
   password, pw  Get password from url
   path, pt      Get path from url
   host, h       Get hostname from url
   port, p       Get port from url
   query, q      Get query from url
   fragment, f   Get fragment from url
   help, h       Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --url value    source url to parse [$URL_PARSER_URL]
   --help, -h     show help (default: false)
   --version, -v  print the version (default: false)

Examples

$ url-parser host --url https://somedomain.com
somedomain.com

$ url-parser user --url https://herloct@somedomain.com
herloct

$ url-parser path --url https://somedomain.com/path/to
/path/to

$ url-parser path --path-index=1 --url https://somedomain.com/path/to
to

$ url-parser query --url https://somedomain.com/?some-key=somevalue
some-key=somevalue

$ url-parser query --query-field=some-key --url https://somedomain.com/?some-key=somevalue
somevalue

Contributors

Special thanks goes to all contributors.

License

This project is licensed under the MIT License - see the LICENSE file for details.