curl / Mailing Lists / curl-library / 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: Adding a new --option to the tool

From: Daniel Stenberg via curl-library <curl-library_at_lists.haxx.se>
Date: Mon, 28 Aug 2023 19:24:47 +0200 (CEST)

On Mon, 28 Aug 2023, Florents Tselai via curl-library wrote:

> For reference you could check the last commit here
> https://github.com/Florents-Tselai/curl/commit/d6ce0b1a0c619f8df1fb61a2638848d25e2aab75

You have not added code in src/tool_getparam.c:getparameter() that actually
does something when the option is provided. I'm guessing you want it something
like the patch below.

You should probably pause and reconsider if this is code for the library or
maybe in the tool only.

--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
_at__at_ -1540,10 +1540,13 _at__at_ ParameterError getparameter(const char *flag, /* f or
-long-flag */
      case ':':
        switch(subletter) {
        case 'a': /* --variable */
          err = setvariable(global, nextarg);
          break;
+ case 'b': /* --warc-file */
+ GetStr(&config->warc_file, nextarg);
+ break;
        default: /* --next */
          err = PARAM_NEXT_OPERATION;
          break;
        }
        break;


-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-08-28