Skip to content

Commit 975cb6f

Browse files
committed
Adjust help messages
1 parent b9f5a08 commit 975cb6f

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,20 @@ Simple command line utility for tracing HTTP requests over redirects.
66
Usage: htrace [OPTIONS] URL
77
88
Options:
9-
-T, --timeout INTEGER Request timeout in seconds
109
-a, --accept TEXT Accept header value
1110
-b, --body Show response body
11+
-C, --colors Console colors
1212
-j, --json Report in JSON
1313
-k, --insecure Don't verify certificates
1414
-L, --link-type TEXT Follow link header with type
15+
-m, --minimal Minimal redirect info
1516
-P, --link-profile TEXT Follow link header with profile
1617
-R, --link-rel TEXT Follow link header with rel
18+
-T, --timeout INTEGER Request timeout in seconds
1719
-U, --user-agent TEXT User agent header value
20+
--log_time Show timestamp in output
1821
--help Show this message and exit.
19-
--version Print version info
22+
--version Show the version and exit.
2023
```
2124

2225
Example:

htrace/__main__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@
1919
# Global for access by event hooks
2020
session = requests.Session()
2121

22+
2223
def enableColors():
23-
global W,R,G,O,B,P
24+
global W, R, G, O, B, P
2425
W = "\033[0m" # white (normal)
2526
R = "\033[31m" # red
2627
G = "\033[32m" # green
2728
O = "\033[33m" # orange
2829
B = "\033[34m" # blue
2930
P = "\033[35m" # purple
3031

32+
3133
def printSummary(s):
3234
L = logging.getLogger("SUMMARY:")
3335
L.info(f"Start URL: {s['responses'][0]['url']}")
@@ -100,39 +102,37 @@ def cbLinkFollow(response, *args, **kwargs):
100102
@click.command()
101103
@click.version_option()
102104
@click.argument("url")
103-
@click.option("-T", "--timeout", default=10, help="Request timeout in seconds")
104105
@click.option("-a", "--accept", default="*/*", help="Accept header value")
105106
@click.option("-b", "--body", is_flag=True, help="Show response body")
106-
@click.option(
107-
"-C", "--colors", default=False, is_flag=True, help="Console colors"
108-
)
107+
@click.option("-C", "--colors", default=False, is_flag=True, help="Enable console colors")
109108
@click.option("-j", "--json", "json_report", is_flag=True, help="Report in JSON")
110109
@click.option(
111110
"-k", "--insecure", default=False, is_flag=True, help="Don't verify certificates"
112111
)
113112
@click.option("-L", "--link-type", default=None, help="Follow link header with type")
113+
@click.option("-m", "--minimal", is_flag=True, help="Minimal redirect info")
114114
@click.option(
115115
"-P", "--link-profile", default=None, help="Follow link header with profile"
116116
)
117117
@click.option(
118118
"-R", "--link-rel", default="alternate", help="Follow link header with rel"
119119
)
120+
@click.option("-T", "--timeout", default=10, help="Request timeout in seconds")
120121
@click.option("-U", "--user-agent", default=None, help="User agent header value")
121-
@click.option("-m", "--minimal", is_flag=True, help="Minimal redirect info")
122122
@click.option("--log_time", is_flag=True, help="Show timestamp in output")
123123
def main(
124124
url,
125-
timeout,
126125
accept,
127126
body,
128127
colors,
129128
json_report,
130129
insecure,
131130
link_type,
131+
minimal,
132132
link_profile,
133133
link_rel,
134+
timeout,
134135
user_agent,
135-
minimal,
136136
log_time,
137137
):
138138
if insecure:

0 commit comments

Comments
 (0)