소스 검색

Fix completion for nested optional parameters

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

+ 10 - 10
clish/shell/shell_parse.c

@@ -209,16 +209,16 @@ clish_pargv_status_t clish_shell_parse_pargv(clish_pargv_t *pargv,
 				 */
 				if (!(clish_param__get_optional(param) &&
 					(*idx == need_index) &&
-					(need_index == (argc - 1))))
-				(*idx)++;
-
-				/* Walk through the nested parameters */
-				if (rec_paramc) {
-					retval = clish_shell_parse_pargv(pargv, cmd,
-						context, rec_paramv,
-						argv, idx, last, need_index);
-					if (CLISH_LINE_OK != retval)
-						return retval;
+					(need_index == (argc - 1)))) {
+					(*idx)++;
+					/* Walk through the nested parameters */
+					if (rec_paramc) {
+						retval = clish_shell_parse_pargv(pargv, cmd,
+							context, rec_paramv,
+							argv, idx, last, need_index);
+						if (CLISH_LINE_OK != retval)
+							return retval;
+					}
 				}
 
 				/* Choose the next parameter */