|
@@ -209,28 +209,15 @@ clish_command_t *clish_view_resolve_command(clish_view_t * this,
|
|
|
|
|
|
clish_command_t *clish_view_find_command(clish_view_t * this, const char *name, bool_t inherit)
|
|
|
{
|
|
|
- clish_command_t *cmd, *link, *result = NULL;
|
|
|
+ clish_command_t *cmd, *result = NULL;
|
|
|
clish_nspace_t *nspace;
|
|
|
unsigned cnt = clish_view__get_nspace_count(this);
|
|
|
int i;
|
|
|
|
|
|
|
|
|
result = lub_bintree_find(&this->tree, name);
|
|
|
-
|
|
|
|
|
|
- if (result && clish_command__get_alias(result)) {
|
|
|
- link = clish_command_new_link_from_alias(result);
|
|
|
-
|
|
|
- lub_bintree_remove(&this->tree, result);
|
|
|
- clish_command_delete(result);
|
|
|
- if (-1 == lub_bintree_insert(&this->tree, link)) {
|
|
|
-
|
|
|
- clish_command_delete(link);
|
|
|
- link = NULL;
|
|
|
- }
|
|
|
- result = link;
|
|
|
-printf("!!!!!!!!!!! transform %s\n", clish_command__get_name(result));
|
|
|
- }
|
|
|
+ result = clish_command_alias_to_link(result);
|
|
|
|
|
|
if (inherit) {
|
|
|
for (i = cnt - 1; i >= 0; i--) {
|
|
@@ -241,11 +228,6 @@ printf("!!!!!!!!!!! transform %s\n", clish_command__get_name(result));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -271,6 +253,8 @@ static const clish_command_t *find_next_completion(clish_view_t * this,
|
|
|
name = iter_cmd;
|
|
|
}
|
|
|
while ((cmd = lub_bintree_findnext(&this->tree, name))) {
|
|
|
+
|
|
|
+ cmd = clish_command_alias_to_link(cmd);
|
|
|
name = clish_command__get_name(cmd);
|
|
|
if (words == lub_argv_wordcount(name)) {
|
|
|
|