Skip to content

Commit a5613a9

Browse files
committed
C-API: cligen expandv -> expand change
Test: Revert patch for Partial match of expanded command
1 parent b9f774a commit a5613a9

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

apps/backend/backend_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ from_client_process_control(clixon_handle h,
19331933
/*! Clixon hello to check liveness
19341934
*
19351935
* @param[in] h Clixon handle
1936-
* @param[in] xn Request: <rpc><xn></rpc>
1936+
* @param[in] xe Request: <rpc><xn></rpc>
19371937
* @param[out] cbret Return xml tree, eg <rpc-reply>..., <rpc-error..
19381938
* @param[in] arg client-entry
19391939
* @param[in] regarg User argument given at rpc_callback_register()

apps/cli/cli_generate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,7 +1984,7 @@ yang2cli_grouping(clixon_handle h,
19841984
* handle=NULL for global namespace, this means expand callbacks must be in
19851985
* CLICON namespace, not in a cli frontend plugin.
19861986
*/
1987-
if (cligen_expandv_str2fn(pt0, (expandv_str2fn_t*)clixon_str2fn, NULL) < 0)
1987+
if (cligen_expand_str2fn(pt0, (expand_str2fn_t*)clixon_str2fn, NULL) < 0)
19881988
goto done;
19891989
/* Append cligen tree and name it */
19901990
if (ph_add_set(cli_cligen(h), treename, pt0) < 0)
@@ -2128,7 +2128,7 @@ yang2cli_yspec(clixon_handle h,
21282128
* handle=NULL for global namespace, this means expand callbacks must be in
21292129
* CLICON namespace, not in a cli frontend plugin.
21302130
*/
2131-
if (cligen_expandv_str2fn(pt0, (expandv_str2fn_t*)clixon_str2fn, NULL) < 0)
2131+
if (cligen_expand_str2fn(pt0, (expand_str2fn_t*)clixon_str2fn, NULL) < 0)
21322132
goto done;
21332133
/* Append cligen tree and name it */
21342134
if (ph_add_set(cli_cligen(h), treename, pt0) < 0)

apps/cli/cli_plugin.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,11 @@ clispec_load_file(clixon_handle h,
288288
filename, plgnam, plgnam);
289289
goto done;
290290
}
291-
if (cligen_expandv_str2fn(pt, (expandv_str2fn_t*)clixon_str2fn, handle) < 0)
292-
goto done;
293-
/* Variable translation functions */
294-
if (cligen_translate_str2fn(pt, (translate_str2fn_t*)clixon_str2fn, handle) < 0)
295-
goto done;
291+
if (cligen_expand_str2fn(pt, (expand_str2fn_t*)clixon_str2fn, handle) < 0)
292+
goto done;
293+
/* Variable translation functions */
294+
if (cligen_translate_str2fn(pt, (translate_str2fn_t*)clixon_str2fn, handle) < 0)
295+
goto done;
296296

297297
/* Make sure we have a syntax mode specified */
298298
if (mode == NULL || strlen(mode) < 1) { /* may be null if not given in file */
@@ -359,7 +359,7 @@ clispec_load_file(clixon_handle h,
359359
}
360360
cligen_parsetree_free(pt, 1);
361361
retval = 0;
362-
done:
362+
done:
363363
if (cvv)
364364
cvec_free(cvv);
365365
if (vec)

test/test_autocli_preference.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,10 @@ expectpart "$($clixon_cli -1 -f $cfg three bcd 2>&1)" 0 "arg = three"
164164
new "cli set aa:bb"
165165
expectpart "$($clixon_cli -1 -f $cfg set twobyte aa:bb 2>&1)" 0 "^$"
166166

167+
if false; then # Only if CLIGEN_DONT_MATCH_PARTIAL_EXPANDS set in cligen_custom.h
167168
new "cli set aa: should fail"
168169
expectpart "$($clixon_cli -1 -f $cfg set twobyte aa: 2>&1)" 255 "Partial match"
170+
fi
169171

170172
if [ $BE -ne 0 ]; then
171173
new "Kill backend"

0 commit comments

Comments
 (0)