cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: prompting for password when username is specified in URL

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 14 Jan 2014 00:07:48 +0100 (CET)

On Thu, 9 Jan 2014, Jeremy Lin wrote:

> Currently it seems that you need to pass -u to get curl to prompt for a
> password, so something like 'curl -O sftp://user@example.com/foo.txt'
> wouldn't prompt for a password, but would end up passing an empty password
> instead.
>
> Is there a good reason for this behavior, or is it just that no one's
> implemented it yet?

The command line tool curl never really parses the URL so it would take quite
a lot of work to introduce such a change. But also, I've not really seen the
need since you can easily provide the name with -u if you want to get
prompted. Or write a wrapper script that prompts and create the proper URL
before you pass it to curl!

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-01-14