Adapt to cligen parse API
This commit is contained in:
parent
79d1d2e95a
commit
e1a8e0d40b
3 changed files with 9 additions and 9 deletions
|
|
@ -1404,7 +1404,7 @@ yang2cli_yspec(clicon_handle h,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse the buffer using cligen parser. load cli syntax */
|
/* Parse the buffer using cligen parser. load cli syntax */
|
||||||
if (cligen_parse_str(cli_cligen(h), cbuf_get(cb), "yang2cli", pt, NULL) < 0){
|
if (clispec_parse_str(cli_cligen(h), cbuf_get(cb), "yang2cli", NULL, pt, NULL) < 0){
|
||||||
fprintf(stderr, "%s\n", cbuf_get(cb));
|
fprintf(stderr, "%s\n", cbuf_get(cb));
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ cli_parse_file(clicon_handle h,
|
||||||
{
|
{
|
||||||
cligen_handle ch = cligen(h);
|
cligen_handle ch = cligen(h);
|
||||||
|
|
||||||
return cligen_parse_file(ch, f, name, pt, globals);
|
return clispec_parse_file(ch, f, name, NULL, pt, globals);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
||||||
|
|
@ -282,9 +282,9 @@ autocli_trees_default(clicon_handle h)
|
||||||
clicon_err(OE_UNIX, errno, "pt_new");
|
clicon_err(OE_UNIX, errno, "pt_new");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (cligen_parse_str(cli_cligen(h),
|
if (clispec_parse_str(cli_cligen(h),
|
||||||
"@basemodel, @remove:act-prekey, @remove:act-list, @remove:act-leafconst, @remove:ac-state;",
|
"@basemodel, @remove:act-prekey, @remove:act-list, @remove:act-leafconst, @remove:ac-state;",
|
||||||
"datamodel", pt, NULL) < 0)
|
"datamodel", NULL, pt, NULL) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
if (cligen_ph_parsetree_set(ph, pt) < 0)
|
if (cligen_ph_parsetree_set(ph, pt) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -297,9 +297,9 @@ autocli_trees_default(clicon_handle h)
|
||||||
clicon_err(OE_UNIX, errno, "pt_new");
|
clicon_err(OE_UNIX, errno, "pt_new");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (cligen_parse_str(cli_cligen(h),
|
if (clispec_parse_str(cli_cligen(h),
|
||||||
"@basemodel, @remove:act-leafvar, @remove:ac-state;",
|
"@basemodel, @remove:act-leafvar, @remove:ac-state;",
|
||||||
"datamodelshow", pt, NULL) < 0)
|
"datamodelshow", NULL, pt, NULL) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
if (cligen_ph_parsetree_set(ph, pt) < 0)
|
if (cligen_ph_parsetree_set(ph, pt) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -311,9 +311,9 @@ autocli_trees_default(clicon_handle h)
|
||||||
clicon_err(OE_UNIX, errno, "pt_new");
|
clicon_err(OE_UNIX, errno, "pt_new");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (cligen_parse_str(cli_cligen(h),
|
if (clispec_parse_str(cli_cligen(h),
|
||||||
"@basemodel, @remove:act-leafvar;",
|
"@basemodel, @remove:act-leafvar;",
|
||||||
"datamodelstate", pt, NULL) < 0)
|
"datamodelstate", NULL, pt, NULL) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
if (cligen_ph_parsetree_set(ph, pt) < 0)
|
if (cligen_ph_parsetree_set(ph, pt) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -352,7 +352,7 @@ autocli_trees_default(clicon_handle h)
|
||||||
if (mode == 0)
|
if (mode == 0)
|
||||||
cprintf(cb, ", @remove:ac-leaf");
|
cprintf(cb, ", @remove:ac-leaf");
|
||||||
cprintf(cb, ";");
|
cprintf(cb, ";");
|
||||||
if (cligen_parse_str(cli_cligen(h), cbuf_get(cb), "datamodelmode", pt, NULL) < 0)
|
if (clispec_parse_str(cli_cligen(h), cbuf_get(cb), "datamodelmode", NULL, pt, NULL) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
if (cligen_ph_parsetree_set(ph, pt) < 0)
|
if (cligen_ph_parsetree_set(ph, pt) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue