Sfoglia il codice sorgente

tool: update --help with categories

This commit is a part of "--help me if you can"

Closes #5680
Emil Engler 3 anni fa
parent
commit
aa8777f63f
5 ha cambiato i file con 545 aggiunte e 238 eliminazioni
  1. 1 0
      src/tool_cfgable.h
  2. 1 0
      src/tool_getparam.c
  3. 541 236
      src/tool_help.c
  4. 1 1
      src/tool_help.h
  5. 1 1
      src/tool_operate.c

+ 1 - 0
src/tool_cfgable.h

@@ -312,6 +312,7 @@ struct GlobalConfig {
   bool parallel;
   long parallel_max;
   bool parallel_connect;
+  char *help_category;            /* The help category, if set */
   struct OperationConfig *first;
   struct OperationConfig *current;
   struct OperationConfig *last;   /* Always last in the struct */

+ 1 - 0
src/tool_getparam.c

@@ -1777,6 +1777,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
 
     case 'h': /* h for help */
       if(toggle) {
+        global->help_category = nextarg;
         return PARAM_HELP_REQUESTED;
       }
       /* we now actually support --no-help too! */

File diff suppressed because it is too large
+ 541 - 236
src/tool_help.c


+ 1 - 1
src/tool_help.h

@@ -23,7 +23,7 @@
  ***************************************************************************/
 #include "tool_setup.h"
 
-void tool_help(void);
+void tool_help(const char *category);
 void tool_list_engines(void);
 void tool_version_info(void);
 

+ 1 - 1
src/tool_operate.c

@@ -2536,7 +2536,7 @@ CURLcode operate(struct GlobalConfig *global, int argc, argv_item_t argv[])
 
       /* Check if we were asked for the help */
       if(res == PARAM_HELP_REQUESTED)
-        tool_help();
+        tool_help(global->help_category);
       /* Check if we were asked for the manual */
       else if(res == PARAM_MANUAL_REQUESTED)
         hugehelp();

Some files were not shown because too many files changed in this diff