purl

command module
v0.0.0-...-b76ba8f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2018 License: MIT Imports: 7 Imported by: 0

README

purl

A command-line URL parser.

Usage

purl reads URLs from stdin, parses them according to the provided flags, and prints the result to stdout.

usage: purl [<flags>]

Flags:
  --help                 Show context-sensitive help (also try --help-long and --help-man).
  --scheme               Print the URL scheme
  --opaque               Print the opaque URL part
  --user                 Print the user and password information
  --host                 Print the URL hostname
  --path                 Print the URL path
  --query                Print the URL query
  --fragment             Print the URL fragment
  --separator=SEPARATOR  Separate results by a delimeter
Examples

Print the hostname

$ echo "https://google.com/test" | purl --host
google.com

Print the scheme and hostname

$ echo "https://google.com/test/?q=test" | purl --scheme --host
https://google.com

Print the hostname and path

$ echo "https://google.com/test/?q=test" | purl --host --path
google.com/test/

Print the user:password information:

$ echo "https://jordan-wright:password@google.com/test" | purl --user
jordan-wright:password

Use a comma separator:

$ echo "https://jordan-wright:password@google.com/test" | purl --user --host --path --separator ,
jordan-wright:password,google.com,/test
Build From Source

To build from source, simply go get the package:

go get github.com/jordan-wright/purl

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL