Skip to content

Commit

Permalink
added documentation for parse query command
Browse files Browse the repository at this point in the history
adrianrudnik committed Apr 3, 2019
1 parent 28f39fd commit 181ba8f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
```

0 comments on commit 181ba8f

Please sign in to comment.