浏览代码

Add __full_cmd internal variable. This variable will contain the prefix if it is

git-svn-id: https://klish.googlecode.com/svn/trunk@177 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 13 年之前
父节点
当前提交
937400ef2f
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      clish/variable/variable_expand.c

+ 5 - 1
clish/variable/variable_expand.c

@@ -72,9 +72,13 @@ static char *find_context_var(const context_t * this, const char *name)
 	char *pattern = NULL;
 	regmatch_t pmatches[2];
 
-	if (!lub_string_nocasecmp(name, "__cmd")) {
+	if (!lub_string_nocasecmp(name, "__full_cmd")) {
 		if (this->cmd)
 			result = lub_string_dup(clish_command__get_name(this->cmd));
+	} else if (!lub_string_nocasecmp(name, "__cmd")) {
+		if (this->cmd)
+			result = lub_string_dup(clish_command__get_name(
+				clish_command__get_orig(this->cmd)));
 	} else if (!lub_string_nocasecmp(name, "__line")) {
 		if (this->cmd && this->pargv)
 			result = clish_variable__get_line(this->cmd, this->pargv);