소스 검색

Fix 'test' problem with prefixed PARAM.

git-svn-id: https://klish.googlecode.com/svn/trunk@250 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 13 년 전
부모
커밋
34ce492654
2개의 변경된 파일13개의 추가작업 그리고 9개의 파일을 삭제
  1. 9 8
      clish/param/param_dump.c
  2. 4 1
      clish/shell/shell_tinyxml_read.cpp

+ 9 - 8
clish/param/param_dump.c

@@ -12,11 +12,11 @@ void clish_param_dump(const clish_param_t * this)
 	lub_dump_printf("param(%p)\n", this);
 
 	lub_dump_indent();
-	lub_dump_printf("name   : %s\n", this->name);
-	lub_dump_printf("text   : %s\n", this->text);
-	lub_dump_printf("value  : %s\n", this->value);
-	lub_dump_printf("ptype  : %s\n", clish_ptype__get_name(this->ptype));
-	lub_dump_printf("default: %s\n",
+	lub_dump_printf("name     : %s\n", this->name);
+	lub_dump_printf("text     : %s\n", this->text);
+	lub_dump_printf("value    : %s\n", this->value);
+	lub_dump_printf("ptype    : %s\n", clish_ptype__get_name(this->ptype));
+	lub_dump_printf("default  : %s\n",
 			this->defval ? this->defval : "(null)");
 	switch (this->mode) {
 	case CLISH_PARAM_COMMON:
@@ -32,12 +32,13 @@ void clish_param_dump(const clish_param_t * this)
 		mode = "Unknown";
 		break;
 	}
-	lub_dump_printf("mode   : %s\n", mode);
-	lub_dump_printf("paramc : %d\n", clish_paramv__get_count(this->paramv));
+	lub_dump_printf("mode     : %s\n", mode);
+	lub_dump_printf("paramc   : %d\n", clish_paramv__get_count(this->paramv));
 	lub_dump_printf("optional : %s\n",
 			this->optional ? "true" : "false");
-	lub_dump_printf("hidden : %s\n",
+	lub_dump_printf("hidden   : %s\n",
 			this->hidden ? "true" : "false");
+	lub_dump_printf("test     : %s\n", this->test);
 
 	/* Get each parameter to dump their details */
 	for (i = 0; i < clish_paramv__get_count(this->paramv); i++) {

+ 4 - 1
clish/shell/shell_tinyxml_read.cpp

@@ -368,6 +368,9 @@ process_param(clish_shell_t * shell, TiXmlElement * element, void *parent)
 					      CLISH_PARAM_SUBCOMMAND);
 			clish_param__set_optional(opt_param, BOOL_TRUE);
 
+			if (NULL != test)
+				clish_param__set_test(opt_param, test);
+
 			if (cmd)
 				// add the parameter to the command
 				clish_command_insert_param(cmd, opt_param);
@@ -414,7 +417,7 @@ process_param(clish_shell_t * shell, TiXmlElement * element, void *parent)
 				CLISH_PARAM_SUBCOMMAND);
 		}
 
-		if (NULL != test)
+		if ((NULL != test) && (NULL == prefix))
 			clish_param__set_test(param, test);
 
 		if (cmd)