CLI output pipes: Add CLICON_PIPETREE to any cli files, not just the first
This commit is contained in:
parent
cdc305ed2f
commit
6d53603c55
3 changed files with 14 additions and 6 deletions
|
|
@ -48,6 +48,10 @@ Expected: October 2023
|
||||||
|
|
||||||
* Clarified clixon_cli command-line: `clixon_cli [options] [commands] [-- extra-options]`
|
* Clarified clixon_cli command-line: `clixon_cli [options] [commands] [-- extra-options]`
|
||||||
|
|
||||||
|
### Corrected Bugs
|
||||||
|
|
||||||
|
* Fixed: CLI output pipes: Add CLICON_PIPETREE to any cli files, not just the first
|
||||||
|
|
||||||
## 6.3.0
|
## 6.3.0
|
||||||
29 July 2023
|
29 July 2023
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,6 @@ static int
|
||||||
gen_parse_tree(clicon_handle h,
|
gen_parse_tree(clicon_handle h,
|
||||||
char *name,
|
char *name,
|
||||||
parse_tree *pt,
|
parse_tree *pt,
|
||||||
char *pipetree,
|
|
||||||
pt_head **php)
|
pt_head **php)
|
||||||
{
|
{
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
|
|
@ -102,9 +101,6 @@ gen_parse_tree(clicon_handle h,
|
||||||
clicon_err(OE_UNIX, errno, "cligen_ph_prompt_set");
|
clicon_err(OE_UNIX, errno, "cligen_ph_prompt_set");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (pipetree &&
|
|
||||||
cligen_ph_pipe_set(ph, pipetree) < 0)
|
|
||||||
goto done;
|
|
||||||
*php = ph;
|
*php = ph;
|
||||||
retval = 0;
|
retval = 0;
|
||||||
done:
|
done:
|
||||||
|
|
@ -328,7 +324,7 @@ clispec_load_file(clicon_handle h,
|
||||||
clicon_err(OE_UNIX, errno, "pt_new");
|
clicon_err(OE_UNIX, errno, "pt_new");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (gen_parse_tree(h, name, ptnew, pipetree, &ph) < 0)
|
if (gen_parse_tree(h, name, ptnew, &ph) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
if (ph == NULL)
|
if (ph == NULL)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -344,6 +340,9 @@ clispec_load_file(clicon_handle h,
|
||||||
if (cv)
|
if (cv)
|
||||||
cv_free(cv);
|
cv_free(cv);
|
||||||
}
|
}
|
||||||
|
if (pipetree) /* Set if any file has it (never reset) */
|
||||||
|
if (cligen_ph_pipe_set(ph, pipetree) < 0)
|
||||||
|
goto done;
|
||||||
if (cligen_parsetree_merge(cligen_ph_parsetree_get(ph), NULL, pt) < 0){
|
if (cligen_parsetree_merge(cligen_ph_parsetree_get(ph), NULL, pt) < 0){
|
||||||
clicon_err(OE_PLUGIN, errno, "cligen_parsetree_merge");
|
clicon_err(OE_PLUGIN, errno, "cligen_parsetree_merge");
|
||||||
goto done;
|
goto done;
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,12 @@ show("Show a particular state of the system"){
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# First file of mode does not have CLICON_PIPETREE, next have
|
||||||
|
cat <<EOF > $clidir/before.cli
|
||||||
|
CLICON_MODE="default";
|
||||||
|
dummy;
|
||||||
|
EOF
|
||||||
|
|
||||||
cat <<EOF > $clidir/default.cli
|
cat <<EOF > $clidir/default.cli
|
||||||
CLICON_MODE="default";
|
CLICON_MODE="default";
|
||||||
CLICON_PROMPT="%U@%H %W> ";
|
CLICON_PROMPT="%U@%H %W> ";
|
||||||
|
|
@ -110,7 +116,6 @@ EOF
|
||||||
cat <<EOF > $clidir/treeref.cli
|
cat <<EOF > $clidir/treeref.cli
|
||||||
CLICON_MODE="treeref";
|
CLICON_MODE="treeref";
|
||||||
CLICON_PIPETREE="|mypipe";
|
CLICON_PIPETREE="|mypipe";
|
||||||
|
|
||||||
implicit("Show configuration"), cli_show_auto_mode("candidate", "xml", true, false);
|
implicit("Show configuration"), cli_show_auto_mode("candidate", "xml", true, false);
|
||||||
explicit("Show configuration"), cli_show_auto_mode("candidate", "xml", true, false);{
|
explicit("Show configuration"), cli_show_auto_mode("candidate", "xml", true, false);{
|
||||||
@|mypipe, cli_show_auto_mode("candidate", "xml", true, false);
|
@|mypipe, cli_show_auto_mode("candidate", "xml", true, false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue