Re: debugging config files options

Timothe Litt via curl-users <[email protected]>
Newsgroups gmane.comp.web.curl.general
Message-ID <[email protected]>
On 04-Apr-24 17:47, Daniel Stenberg via curl-users wrote:
> Hello,
>
> Sometimes users accidentally get "funny" or unexplainable behavior 
> from curl command lines when they have options added in their .curlrc 
> or other config files.
>
> The use of .curlrc is a little subtle and sometimes hard to spot and I 
> have pondered on what we can do to make it easier to debug or trace 
> what options are being used in such config files.
>
> A challenge is that ~/.curlrc is read and parsed before any command 
> line options. So how do we active the config file debug mode?
>
> 1. If -v or --verbose is used as the *first option* on the command line.
>
> 2. If the environment variable named CURL_CONFIG_TRACE is set to 1.
>
> Or can we come up with a better way?
>

One approach I've used is to look at the command name.

e.g. ln -s /usr/bin/curl /usr/bin/tcurl

tcurl ...

curl looks at $0 and enables tracing if called as tcurl.

similar to /bin/view which is a symlink to vi and triggers read-only mode.

Timothe Litt
ACM Distinguished Engineer
--------------------------
This communication may not represent the ACM or my employer's views,
if any, on the matters discussed.

-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
OpenPGP_signature.asc (application/pgp-signature, 495 B)
-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEE0UvvF0GpbrNhifE5DTaRiR4XoSQFAmYPO94FAwAAAAAACgkQDTaRiR4XoSRH
5wf+OEAv0OIaTIFp4SxW9rkD+Q1J4rbs42l9MJsxi/7cijO+V0t/Wzvx8dFo1cOJiB6vW4t0ve7z
1rmBHxiiLyeWq4d73HDnW5B9X3U00LwIOfMPSDMk4AKd7CzzfVQ045NRtkooDGeBcObo6Bg/+qyD
u40AgS0SwgzPA6H9rfX5CbvkOTTDBrUnd9aDRAx5nyDGTuWNYE5Dr8I5F8FzVH7bQ+IR6nXRFcom
xNGPjwlvD3woOfSNiQ/lh2IorHyyLbqyvkOZfDfJ9IvdyMvLdgoiPMcJjUHvgg6SV392rxaVYeSY
fZ0RJAXrAPfsl6JVlPQiLIUmQNoZ6j+cpG8djqMyOQ==
=A8yt
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.