Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
soc:fredrikhultin [2006/07/11 23:54]
noname
soc:fredrikhultin [2006/07/12 00:24] (current)
noname
Line 83: Line 83:
   /* Name and describe the list set */   /* Name and describe the list set */
   cmdl_param_list_set_name(ipv4,​ "​ipv4"​);​   cmdl_param_list_set_name(ipv4,​ "​ipv4"​);​
-  ​cmdl_param_list_set_descr(ipv4, "Set the IP adress and netmask (IPv4)"​);​+  ​cmdl_param_list_set_desc(ipv4, "Set the IP adress and netmask (IPv4)"​);​
  
   /* Add the parameters with name, type and example value */   /* Add the parameters with name, type and example value */
Line 97: Line 97:
   /* Name and describe the list set */   /* Name and describe the list set */
   cmdl_param_list_set_name(ipv6,​ "​ipv6"​);​   cmdl_param_list_set_name(ipv6,​ "​ipv6"​);​
-  ​cmdl_param_list_set_descr(ipv6, "Set the IP adress (IPv6)"​);​+  ​cmdl_param_list_set_desc(ipv6, "Set the IP adress (IPv6)"​);​
  
   cmdl_param_list_set_add(ipv6,​ "​ip",​ CMDL_IPV6, "​2001:​0db8::​1428:​57ab"​);​   cmdl_param_list_set_add(ipv6,​ "​ip",​ CMDL_IPV6, "​2001:​0db8::​1428:​57ab"​);​
Line 109: Line 109:
   /* Name and describe the list set */   /* Name and describe the list set */
   cmdl_param_list_set_name(view,​ "​view"​);​   cmdl_param_list_set_name(view,​ "​view"​);​
-  ​cmdl_param_list_set_descr(view, "View the IP/​netmask"​);​+  ​cmdl_param_list_set_desc(view, "View the IP/​netmask"​);​
  
   /* (No parameters = view) */   /* (No parameters = view) */
Line 170: Line 170:
 } }
 </​code>​ </​code>​
 +
 +Observe that the output of "help ip" is generated from this implementation.
  
 ==== Structures ==== ==== Structures ====
Line 298: Line 300:
  
 <​code>​ <​code>​
-cmdl_param_list_set* cmdl_param_list_set_create()+cmdl_param_list_set* cmdl_param_list_set_create();
 </​code>​ </​code>​
  
Line 354: Line 356:
 </​code>​ </​code>​
  
- +==== Concerns ==== 
-ter_list_setlist_set)+Perhaps this implementation would be a bit over the top. I got an email from Michael last week and he suggested, without reading this, that I should use ordinary C-style command structures (int argc, char** argv). That might not be as grandiose, and it would be harder to generate standardized automated help output, but it'd be much easier to implement. With some nice parse helper functions available to the command implementations,​ then perhaps it wouldn'​t be so bad. Hmm...
-</​code>​ +
- +
  
 ===== Status ===== ===== Status =====
  
 The command line is working and accepts input from the user, which it parses and then, at the moment, disregards. The command line is working and accepts input from the user, which it parses and then, at the moment, disregards.

QR Code
QR Code soc:fredrikhultin (generated for current page)