hurl/docs/manual/hurlfmt.1

137 lines
1.9 KiB
Groff
Raw Normal View History

2024-04-24 14:56:06 +03:00
.TH hurl 1 "24 Apr 2024" "hurl 5.0.0-SNAPSHOT" " Hurl Manual"
2021-12-13 14:20:34 +03:00
.SH NAME
hurlfmt - format Hurl files
.SH SYNOPSIS
.B hurlfmt
2023-06-28 17:14:06 +03:00
[options] [FILE...]
2021-12-13 14:20:34 +03:00
.SH DESCRIPTION
.B hurlfmt
2023-05-03 14:34:40 +03:00
formats Hurl files and converts them from/to other formats.
2021-12-13 14:20:34 +03:00
With no FILE, read standard input.
By default, hurlfmt outputs a formatted and colorized version of the input hurl file.
$ hurl hello.hurl
GET http://localhost:8000/hello
HTTP/1.0 200
hurlfmt can be used to convert to other format.
$ hurl hello.hurl --output json | jq
{
"entries": [
{
"request": {
"method": "GET",
"url": "http://localhost:8000/hello"
},
"response": {
"version": "HTTP/1.0",
"status": 200
}
}
]
}
2023-05-03 14:34:40 +03:00
hurlfmt can also be used to convert a curl command-line to Hurl
$ echo "curl http://localhost:8000/custom-headers -H 'Fruit:Raspberry'" | hurlfmt --in curl
GET http://localhost:8000/custom-headers
Fruit: Raspberry
2021-12-13 14:20:34 +03:00
.SH OPTIONS
.IP "--check "
Run in 'check' mode. Exits with 0 if input is formatted correctly, 1 otherwise.
2021-12-13 14:20:34 +03:00
This can not be used with \fI--output\fP.
This option is not stable yet.
.IP "--color "
Colorize Output.
This can not be used \fI--in-place\fP.
2023-05-03 14:34:40 +03:00
.IP "--in <FORMAT> "
2023-05-03 14:34:40 +03:00
Specify input format: hurl or curl.
2021-12-13 14:20:34 +03:00
2024-01-03 19:20:12 +03:00
.IP "--in-place "
2021-12-13 14:20:34 +03:00
Modify file in place.
This can be used only with text output.
.IP "--no-color "
Do not colorize output.
2021-12-13 14:20:34 +03:00
.IP "--out <FORMAT> "
2021-12-13 14:20:34 +03:00
Specify output format: hurl, json or html.
2021-12-13 14:20:34 +03:00
.IP "-o, --output <FILE> "
2021-12-13 14:20:34 +03:00
Write output to FILE instead of stdout.
2021-12-13 14:20:34 +03:00
.IP "--standalone "
Output full html file with css instead of html fragment (default).
2021-12-13 14:20:34 +03:00
This can be used only with html output.
.IP "-h, --help "
Usage help.
2021-12-13 14:20:34 +03:00
.IP "-V, --version "
Prints version information
.SH EXIT CODES
.IP "1"
Failed to parse command-line options.
.IP "2"
Input File Parsing Error.
.SH WWW
\fIhttps://hurl.dev\fP
.SH SEE ALSO
hurl(1)