command_dump.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifdef DEBUG
  2. /*
  3. * command_dump.c
  4. */
  5. #include "lub/dump.h"
  6. #include "private.h"
  7. /*--------------------------------------------------------- */
  8. void clish_command_dump(const clish_command_t * this)
  9. {
  10. unsigned i;
  11. lub_dump_printf("command(%p)\n", this);
  12. lub_dump_indent();
  13. lub_dump_printf("name : %s\n", this->name);
  14. lub_dump_printf("text : %s\n", this->text);
  15. lub_dump_printf("link : %s\n",
  16. this->link ? clish_command__get_name(this->link) : "(null)");
  17. lub_dump_printf("alias : %s\n", this->alias);
  18. lub_dump_printf("alias_view : %s\n",
  19. this->alias_view ? clish_view__get_name(this->alias_view) : "(null)");
  20. lub_dump_printf("paramc : %d\n", clish_paramv__get_count(this->paramv));
  21. lub_dump_printf("detail : %s\n",
  22. this->detail ? this->detail : "(null)");
  23. clish_action_dump(this->action);
  24. clish_config_dump(this->config);
  25. /* Get each parameter to dump their details */
  26. for (i = 0; i < clish_paramv__get_count(this->paramv); i++) {
  27. clish_param_dump(clish_command__get_param(this, i));
  28. }
  29. lub_dump_undent();
  30. }
  31. /*--------------------------------------------------------- */
  32. #endif /* DEBUG */