From 181ba8fc248f5d4d14937b1b142c80c0298f3fab Mon Sep 17 00:00:00 2001 From: Adrian Rudnik Date: Thu, 4 Apr 2019 00:47:21 +0200 Subject: [PATCH] added documentation for parse query command --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 834116f..77551db 100644 --- a/README.md +++ b/README.md @@ -107,3 +107,24 @@ uritool parse uri --format="Second entry is {{index .Query.things 1}}" "https:// # > Second entry is two ``` + +You can also parse query strings (leading "?" will be removed): + +```sh +uritool parse query "?this=is&this=isnot" + +# > { +# > "this": [ +# > "is", +# > "isnot" +# > ] +# > } +``` + +This is also workable with the [go template](https://golang.org/pkg/text/template/) language: + +```sh +uritool parse query -n --format="{{index .search 0}}" "search=mister&filter=x" + +# > mister +```