44 Commits

Author SHA1 Message Date
Jan Verbeek
41ab47f32f Add --debug option for logging and backtraces
Add `env_logger` to be able to print the logs that our libraries
already generate.

Add some logging to the application code. We'll probably want more log
messages, and we might want to upgrade some of them from trace to
debug.

Add a `--debug` flag that automatically enables `env_logger` as well
as backtraces for `anyhow` and panics.

```console
$ xh --debug :
[2024-06-05T13:54:40Z DEBUG xh] xh 0.22.0 -native-tls +rustls
[2024-06-05T13:54:40Z DEBUG xh] Cli {
        httpie_compat_mode: false,
        [...]
    }
[2024-06-05T13:54:40Z DEBUG xh] Complete URL: http://localhost/
[2024-06-05T13:54:40Z DEBUG xh] HTTP method: GET
[2024-06-05T13:54:40Z DEBUG reqwest::connect] starting new connection: http://localhost/
[2024-06-05T13:54:40Z DEBUG hyper_util::client::legacy::connect::dns] resolving host="localhost"
[...]
xh: error: error sending request for url (http://localhost/)

Caused by:
    0: client error (Connect)
    1: tcp connect error: Connection refused (os error 111)
    2: Connection refused (os error 111)

Stack backtrace:
   0: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
             at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.82/src/error.rs:565:25
[...]
```

We could ask users to post `--debug` output when reporting bugs.
2024-06-05 17:47:36 +02:00
Mohamed Daahir
55253e12e9
mention that NO_PROXY affects proxies from env only
Co-authored-by: Jan Verbeek <jan.verbeek@posteo.nl>
2022-12-13 20:58:44 +00:00
Mohamed Daahir
a1759d8c4c
describe input of http_proxy and HTTPS_PROXY env vars
Co-authored-by: Jan Verbeek <jan.verbeek@posteo.nl>
2022-12-13 20:39:40 +00:00
ducaale
7aaa16810b document NO_PROXY env variable 2022-12-13 18:11:18 +00:00
ducaale
27508051ab mention --curl translation in description
https://github.com/ducaale/xh/pull/250#discussion_r1015842972
2022-11-07 21:29:40 +00:00
ducaale
3b7cb5fb44 use inline formatting in the description section 2022-11-07 21:02:58 +00:00
Mohamed Daahir
08f2485639
rewrite description section of the man page
Co-authored-by: Jan Verbeek <jan.verbeek@posteo.nl>
2022-11-07 20:55:11 +00:00
ducaale
31b9755f6a remove mention of urls that begin with :// 2022-09-27 21:36:14 +01:00
Mohamed Daahir
f734e87457
replace "querystring" with the actual URL example
Co-authored-by: Jan Verbeek <jan.verbeek@posteo.nl>
2022-09-27 21:21:42 +01:00
ducaale
8b66732a80 shorten description for METHOD 2022-09-27 21:17:41 +01:00
Mohamed Daahir
35994941a6
use title case when mentioning header
Co-authored-by: Jan Verbeek <jan.verbeek@posteo.nl>
2022-09-27 21:12:38 +01:00
ducaale
b2de613a63 slight tweak in the examples section 2022-09-25 12:22:55 +01:00
ducaale
c7d9f38caa use "TP 4" everywhere
This is similar to git and ripgrep's man page
2022-09-25 12:15:45 +01:00
ducaale
65cba87ca0 add example for piping request body to xh 2022-09-04 12:30:33 +01:00
ducaale
96916d2f67 move the tty note to under --ignore-stdin
also removes the redundant 2nd paragraph
2022-08-21 23:25:32 +01:00
ducaale
5da2557776 separate URL and Method into two sections 2022-08-14 18:03:45 +01:00
ducaale
98f988c7e0 add section for positional arguments 2022-08-14 18:02:16 +01:00
ducaale
87f51d5eb2 remove pipe example from description 2022-08-12 23:15:01 +01:00
ducaale
8f82ee27f8 move positional argument to the top of OPTIONS 2022-08-12 23:14:07 +01:00
Mohamed Daahir
8bf153ca60
remove mention of HTTPie in the 2nd paragraph
Co-authored-by: Jan Verbeek <jan.verbeek@posteo.nl>
2022-08-12 19:49:52 +01:00
ducaale
2526bb269b correct the config directory for Linux/macOS 2022-08-11 22:52:05 +01:00
ducaale
6f699c8425 mention default config dir for windows 2022-08-11 22:49:09 +01:00
ducaale
0e48caeddd move config docs to the files section 2022-08-11 22:49:09 +01:00
ducaale
1529742254 remove mention of native-tls from the top of the manpage 2022-08-11 22:49:09 +01:00
ducaale
80184a00b9 remove extra newline in options section 2022-08-03 21:12:53 +03:00
ducaale
5cb53dcc18 add example for xhs 2022-07-09 14:55:22 +01:00
ducaale
8afd87b4e7 render xh in bold in the examples section 2022-07-09 14:41:25 +01:00
ducaale
25aea9a8ff render curl & http in bold in "see also" section 2022-07-09 14:40:15 +01:00
ducaale
83d40072a2 add curl(1) and http(1) to SEE ALSO section 2022-06-13 19:25:45 +01:00
ducaale
4a4d2bc5f0 slight man tweaks 2022-06-02 18:17:39 +01:00
ducaale
4560243674 update help for <[METHOD] URL>
this taken from the prev man-template introduced in
https://github.com/ducaale/xh/pull/64
2022-06-02 17:46:23 +01:00
ducaale
15ae3aa5cd fix mispellings 2022-05-22 15:26:47 +01:00
ducaale
397aee6e52 document 2 & 6 exit status codes 2022-05-22 15:20:11 +01:00
ducaale
c11e08686d slight man tweaks 2022-05-21 16:53:24 +01:00
ducaale
0fd7f55395 mention NO_COLOR env 2022-05-03 15:46:25 +01:00
ducaale
8d261a210e custom format for request_item header 2022-05-01 15:03:05 +01:00
ducaale
4e0dfdd83a remove old man page 2022-04-30 17:36:56 +01:00
Jan Verbeek
54369887ef Rename "Flags" man page header to "Options"
Flags don't take an argument, options might.

In the long term we should look at custom subheadings and/or
clap_mangen.
2022-02-15 15:47:30 +01:00
Jan Verbeek
afa23c0319 Document ;filename= parameter 2021-07-20 22:05:35 +02:00
Jan Verbeek
38de30bd82 Support reading request body from file 2021-05-09 18:57:37 +02:00
ducaale
d7f1ba799f update man template 2021-03-29 21:12:36 +01:00
Jan Verbeek
34a815f3d3 Replace --default-scheme by --https 2021-02-22 20:00:21 +01:00
Jan Verbeek
6a4a8b8d46 Support escaping characters in request items with backslash 2021-02-18 01:00:06 +01:00
Jan Verbeek
f36d067a27 Add man page generation 2021-02-16 23:15:01 +01:00