Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve globbing "unmatched brace" error message #2763

Closed
danielshahaf opened this issue Jul 19, 2018 · 0 comments
Closed

Improve globbing "unmatched brace" error message #2763

danielshahaf opened this issue Jul 19, 2018 · 0 comments

Comments

@danielshahaf
Copy link
Contributor

I did this

% curl -d '{ "hello world": null }' http://example.com/{foo
curl: (3) [globbing] unmatched brace in column 20

I thought the error message was referring to the argument to -d and spent a while scratching my had trying to figure out why the first l of null would be reported as the location of the error. (In this instance it may be obvious, but this is a reduced example of a long command line.)

I expected the following

I suggest that the error message be clarified. For example:

  • Change "column" to "character"

  • Include the failing argument in the error message:

      curl: (3) [globbing] unmatched brace at character 20 of «http://example.com/{foo»
    
  • Include part of argument in the error message, e.g.,

      unmatched brace at character 20 (near ".com/{foo")
    

    This is inspired by perl's parser's error reporting:

      % perl -e '}'
      ⋮
      syntax error at -e line 1, near "}"
      ⋮
    

curl/libcurl version

curl 7.60.0 (x86_64-pc-linux-gnu) libcurl/7.60.0 OpenSSL/1.1.0h zlib/1.2.11 libidn2/2.0.4 libpsl/0.20.2 (+libidn2/2.0.4) libssh2/1.8.0 nghttp2/1.32.0 librtmp/2.3
Release-Date: 2018-05-16
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL

(installed via the OS's package manager)

operating system

Debian unstable

bagder added a commit that referenced this issue Sep 11, 2018
to help user understand what the problem is

Fixes #2763
@bagder bagder closed this as completed in ddb06ff Sep 13, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Dec 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

2 participants