mwarkentin / yuri

CLI tool to parse URIs into their components
MIT License
4 stars 3 forks source link

Parse URIs from environment #10

Open mwarkentin opened 7 years ago

mwarkentin commented 7 years ago

Design ideas

Environment

CACHE_URL=redis://stage.example.com:6379/0
DATABASE_URL=postgres://username:password@stage.example.com:5432/database
FOO=BAR

Output

$ yuri --environment | jq
{
  "CACHE_URL": {
    "Scheme": "redis",
    "Opaque": "",
    "User": {},
    "Host": "stage.example.com:6379",
    "Path": "/0",
    "RawPath": "",
    "ForceQuery": false,
    "RawQuery": "",
    "Fragment": ""
  },
  "DATABASE_URL": {
    "Scheme": "postgres",
    "Opaque": "",
    "User": {},
    "Host": "stage.example.com:5432",
    "Path": "/0",
    "RawPath": "",
    "ForceQuery": false,
    "RawQuery": "",
    "Fragment": ""
  }

}
mwarkentin commented 7 years ago