Help system for vm commands should be modularized
Right now, commands are registered this way :
/* General purpose command */ vm_addcmd(CMD_MODLOAD , (void *) cmd_modload , (void *) vm_getoption , 0, HLP_MODLOAD); vm_addcmd(CMD_MODULOAD, (void *) cmd_modunload, (void *) vm_getoption , 0, HLP_MODULOAD); vm_addcmd(CMD_DISASM , (void *) cmd_disasm , (void *) vm_getdisasm , 1, HLP_DISASM); [...]
This way, the string help of each command (HLP_...) is registered at the same time than the command itself.
But HLP_... is a string that is placed in librevm/include/revm-help.h
This makes the creation of complex help quite difficult.
The idea of this task is :
- To replace this HLP_ string with a function pointer help_cmdname() and make that function to display
the help, when typing help
, instead of printing the HLP_ string as it is done right now. - To add a 3rd function pointer : hint_cmdname. That function pointer should register a serie of hints for this command. All hints should be registered in a unique new hash table : hints_hash, standing in librevm/vm/tables.c
- Make a system that print a random hint about a random command just after having registered all commands,
at the beginning of the execution of the shell. ("Did you know it :
.. ")
This system should make the beginner users more easily introduced in the framework.
Enjoy
-may
Ticket: 20 Reported by: jfv on Sun Feb 25 16:25:32 2007