From 2bcd429bee1e3ad778a122ce4ea4b0f72844c355 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Tue, 15 Aug 2023 20:37:30 +0200 Subject: [PATCH] CLI pipe changes: added arg to tail, exit on error. --- CHANGELOG.md | 5 +++++ apps/cli/cli_generate.c | 4 ++-- apps/cli/cli_pipe.c | 35 +++++++++++++++++++++++++++++++---- test/test_cli_pipe.sh | 9 ++++++--- 4 files changed, 44 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e27e691..d71c0c94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,11 @@ ## 6.4.0 Expected: October 2023 +### C/CLI-API changes on existing features +Developers may need to change their code + +* CLI pipe function: added arg to `pipe_tail_fn()` + ### Minor features * Removed sending restconf config inline using -R when CLICON_BACKEND_RESTCONF_PROCESS=true diff --git a/apps/cli/cli_generate.c b/apps/cli/cli_generate.c index 0691d03a..8dd6ffa2 100644 --- a/apps/cli/cli_generate.c +++ b/apps/cli/cli_generate.c @@ -1145,8 +1145,8 @@ yang2cli_uses(clicon_handle h, if (ys_grouping_resolve(ys, prefix, id, &ygrouping) < 0) goto done; if (ygrouping == NULL){ - fprintf(stderr, "%s grouping %s not found\n", __FUNCTION__, id); - goto ok; + clicon_err(OE_YANG, 0, "grouping %s not found in \n", yang_argument_get(ys)); + goto done; } if ((cbtree = cbuf_new()) == NULL){ clicon_err(OE_XML, errno, "cbuf_new"); diff --git a/apps/cli/cli_pipe.c b/apps/cli/cli_pipe.c index 334d12c4..4089daab 100644 --- a/apps/cli/cli_pipe.c +++ b/apps/cli/cli_pipe.c @@ -176,7 +176,7 @@ pipe_wc_fn(clicon_handle h, char *option = NULL; if (cvec_len(argv) != 1){ - clicon_err(OE_PLUGIN, EINVAL, "Received %d arguments. Expected: