|
@@ -117,7 +117,6 @@ clish_pargv_parse(clish_pargv_t * this,
|
|
|
clish_param_t *param = clish_paramv__get_param(paramv,index);
|
|
|
clish_param_t *cparam = NULL;
|
|
|
int is_switch = 0;
|
|
|
- int is_tested = 0;
|
|
|
|
|
|
|
|
|
if (*idx >= argc)
|
|
@@ -129,23 +128,20 @@ clish_pargv_parse(clish_pargv_t * this,
|
|
|
if (CLISH_PARAM_SWITCH == clish_param__get_mode(param))
|
|
|
is_switch = 1;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
if (param) {
|
|
|
char *str = clish_param__get_test(param,
|
|
|
NULL, cmd, this);
|
|
|
- if (!str)
|
|
|
- is_tested = 1;
|
|
|
- else {
|
|
|
- if (lub_system_line_test(str))
|
|
|
- is_tested = 1;
|
|
|
- else
|
|
|
- is_tested = 0;
|
|
|
+ if (str && !lub_system_line_test(str)) {
|
|
|
lub_string_free(str);
|
|
|
+ index++;
|
|
|
+ continue;
|
|
|
}
|
|
|
+ lub_string_free(str);
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (last && (*idx == need_index) && is_tested &&
|
|
|
+ if (last && (*idx == need_index) &&
|
|
|
(NULL == clish_pargv_find_arg(this, clish_param__get_name(param)))) {
|
|
|
if (is_switch) {
|
|
|
clish_paramv_t *rec_paramv = clish_param__get_paramv(param);
|