Giter VIP home page Giter VIP logo

puri's Introduction

puri ("parse uri") is a robust commandline utility that reads and extracts uri components. It processes URLs with and without schemes.

Circleci Builds Github Workflows Github Issues Github Activity
CodeClimate Maintainability CodeClimate Test Coverage Go Version License Version

What's New

v0.1.9

  • bugfix for url withouth proper paths

v0.1.8

  • bugfix for url paths containing domains

v0.1.7

  • added simple path parsing that makes this more intuitive over standard library interpretation

Up and running

Homebrew

brew tap simonmittag/cli &&
  brew install puri &&
  puri 

Golang

git clone https://github.com/simonmittag/puri && cd puri && 
go install github.com/simonmittag/puri/cmd/puri && 
puri 

Usage

~ λ 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

Examples

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

Contributions

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

puri's People

Contributors

simonmittag avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.