give curl colored (yet sortable) plaintext listings

This commit is contained in:
ed 2023-01-17 23:22:43 +00:00
parent cfd24604d5
commit b0e755d410

View file

@ -2654,7 +2654,11 @@ class HttpCli(object):
"dbwt": None,
}
if self.uparam.get("ls") in ["v", "t", "txt"]:
fmt = self.uparam.get("ls", "")
if not fmt and self.ua.startswith("curl/"):
fmt = "v"
if fmt in ["v", "t", "txt"]:
if self.uname == "*":
txt = "howdy stranger (you're not logged in)"
else:
@ -3145,6 +3149,10 @@ class HttpCli(object):
is_ls = "ls" in self.uparam
is_js = self.args.force_js or self.cookies.get("js") == "y"
if not is_ls and self.ua.startswith("curl/"):
self.uparam["ls"] = "v"
is_ls = True
tpl = "browser"
if "b" in self.uparam:
tpl = "browser2"