curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: [PROPOSAL] URL shortcuts

From: Ray Satiro via curl-users <curl-users_at_lists.haxx.se>
Date: Fri, 21 Jan 2022 03:33:40 -0500

On 1/21/2022 3:22 AM, Daniel Stenberg via curl-users wrote:
> Let me bring up another small proposal I picked up from previous
> twitter reply, and see what you all think.
>
> The URL shortcut. The intent is here primarily to save keystrokes for
> commonly repeated URLs for users doing repeated curl command lines
> with variations. (Again a thing for the command line tool only.)
>
> A "URL" that starts with colon (thereby not being a URL at all so the
> command line parser can easily catch when this happens), implies a
> "http://localhost" prefix. Like this:
>
>  $ curl :80/
>
>  $ curl :8080/index.html
>
>  $ curl :/search.cgi?q=crazy
>
> The difference from hacks like where you use 0 as in "curl 0:80/", the
> 0 thing is IPv4-only and it doesn't pass on the hostname. Also, we
> don't really document the 0 trick anywhere, where as the colon-thing
> would be a supported features.
>
> Since this would introduce this idea of a shortcut that isn't really a
> URL when input but gets translated into one when used, it would open
> up the opportunity to do *other* shortcuts or URL trickeries on the
> command line. I can't say that I have managed to come up with any
> suitable additional alternatives.


My first impression is I don't like it. I understand what you are saying
and yet just looking at it I don't find it quick to interpret. If it was
in a script I have a feeling I'd have to do some cognitive processing to
figure it out.

-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2022-01-21