Index: trunk/Ohana/src/opihi/cmd.basic/macro.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.basic/macro.c	(revision 10996)
+++ trunk/Ohana/src/opihi/cmd.basic/macro.c	(revision 11007)
@@ -1,12 +1,3 @@
 # include "basic.h"
-
-static Command macro_command[] = {
-  {"create", macro_create, "create a macro *"},
-  {"delete", macro_delete, "delete a macro *"},
-  {"list",   macro_list_f, "list a macro *"},
-  {"edit",   macro_edit,   "edit a macro <not working yet!> *"},
-  {"read",   macro_read,   "read a macro from a file <not working yet!> *"},
-  {"write",  macro_write,  "write a macro to a file <not working yet!> *"}
-};
 
 int macro (int argc, char **argv) {
@@ -27,17 +18,14 @@
   }
 
-  N = sizeof (macro_command) / sizeof (Command);
+  CommandF *cmd;
 
-  /* find the macro sub-command which matches from the list. */
-  /* if sub-command is not found, assume this is creating a new macro */
-  for (i = 0; i < N; i++) {
-    if (!strcmp (macro_command[i].name, argv[1])) {
-      status = (*macro_command[i].func) (argc - 1, argv + 1);
-      return (status);
-    }
+  cmd = find_macro_command (argv[1]);
+  if (cmd != NULL) {
+    status = (*cmd) (argc - 1, argv + 1);
+  } else {
+    /* sub-command was not found, pass argv[1..N] to macro_create */
+    status = macro_create (argc, argv);
   }
 
-  /* sub-command was not found, pass argv[1..N] to macro_create */
-  status = macro_create (argc, argv);
   return (status);
 }
