summaryrefslogtreecommitdiffhomepage
path: root/mixutils/mixvm_command.c
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2001-07-07 23:34:55 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2001-07-07 23:34:55 +0000
commit8cecf0ae927eae1dfb5ab2eef78f55e8e162a7f9 (patch)
tree8c150bf6c112d1033342556cb520fb34cf7e220a /mixutils/mixvm_command.c
parentfd39c4abe462ec9e749a1a65370cd7a1c11ae705 (diff)
downloadmdk-8cecf0ae927eae1dfb5ab2eef78f55e8e162a7f9.tar.gz
mdk-8cecf0ae927eae1dfb5ab2eef78f55e8e162a7f9.tar.bz2
use of devdir command
Diffstat (limited to 'mixutils/mixvm_command.c')
-rw-r--r--mixutils/mixvm_command.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/mixutils/mixvm_command.c b/mixutils/mixvm_command.c
index 8030eed..b8bef53 100644
--- a/mixutils/mixvm_command.c
+++ b/mixutils/mixvm_command.c
@@ -173,33 +173,23 @@ cmd_help_ (char *arg)
int i;
int printed = 0;
- for (i = 0; commands[i].name; i++)
+ for (i = 1; commands[i].name; i++)
{
- if (!*arg || (strcmp (arg, commands[i].name) == 0))
+ if (!arg || !*arg)
{
- printf (_("%s\t\t%s. Usage: %s\n"), commands[i].name,
- _(commands[i].doc), commands[i].usage);
+ printf (_("%s\t\t%s.\n"), commands[i].name, _(commands[i].doc));
printed++;
}
- }
-
- if (printed > 1) printf ("\n");
-
- for (i = LOCAL_COMANDS_NO_ + 1 /* skip help cmd */; mix_commands_[i]; i++)
- {
- if (!*arg || (strcmp (arg, mix_commands_[i]) == 0))
+ else if (strcmp (arg, commands[i].name) == 0)
{
- printf (_("%s\t\t%s. Usage: %s\n"), mix_commands_[i],
- mix_vm_command_help (i - LOCAL_COMANDS_NO_),
- mix_vm_command_usage (i - LOCAL_COMANDS_NO_));
+ printf (_("%s\t\t%s.\nUsage:\t\t%s\n"), commands[i].name,
+ _(commands[i].doc), commands[i].usage);
printed++;
}
}
-
- if (!printed) printf ("Command \'%s\' not found\n", arg);
-
+ if (!printed ||!arg || !*arg)
+ mix_vm_cmd_dispatcher_dispatch (dis_, MIX_CMD_HELP, arg);
return TRUE;
-
}
static int
@@ -246,7 +236,7 @@ init_dis_ (mix_vm_cmd_dispatcher_t *dis)
}
void
-mixvm_cmd_init (char *arg, gboolean use_emacs)
+mixvm_cmd_init (mix_config_t *config, char *arg, gboolean use_emacs)
{
int k;
/* get local command names */
@@ -263,7 +253,7 @@ mixvm_cmd_init (char *arg, gboolean use_emacs)
#endif /* HAVE_LIBREADLINE */
/* initialise the dispatcher */
- dis_ = mix_vm_cmd_dispatcher_new (stdout, stderr);
+ dis_ = mix_vm_cmd_dispatcher_new_with_config (stdout, stderr, config);
if ( dis_ == NULL)
g_error (_("Failed initialisation (no memory resources)"));