clixon-config.yang: Added CLICON_DEBUG, Removed: CLICON_NETCONF_DUPLICATE_ALLOW
Rearranged and grouped options clixon-lib.yang: Added debug types Removed git reliance in test - moved to configure script
This commit is contained in:
parent
c8a8197e92
commit
b6480ac07d
15 changed files with 320 additions and 174 deletions
|
|
@ -632,6 +632,17 @@ cli_del(clixon_handle h,
|
|||
return retval;
|
||||
}
|
||||
|
||||
/*! Get debug level of CLI client
|
||||
*/
|
||||
int
|
||||
cli_debug_show(clixon_handle h,
|
||||
cvec *cvv,
|
||||
cvec *argv)
|
||||
{
|
||||
cligen_output(stdout, "CLI debug:0x%x\n", clixon_debug_get());
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! Set debug level on CLI client (not backend daemon)
|
||||
*
|
||||
* @param[in] h Clixon handle
|
||||
|
|
@ -644,8 +655,8 @@ cli_del(clixon_handle h,
|
|||
*/
|
||||
int
|
||||
cli_debug_cli(clixon_handle h,
|
||||
cvec *cvv,
|
||||
cvec *argv)
|
||||
cvec *cvv,
|
||||
cvec *argv)
|
||||
{
|
||||
int retval = -1;
|
||||
cg_var *cv;
|
||||
|
|
@ -736,7 +747,6 @@ cli_debug_restconf(clixon_handle h,
|
|||
return retval;
|
||||
}
|
||||
|
||||
|
||||
/*! Set syntax mode
|
||||
*
|
||||
* @param[in] h Clixon handle
|
||||
|
|
|
|||
|
|
@ -751,6 +751,7 @@ main(int argc,
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
|
|
@ -761,6 +762,24 @@ main(int argc,
|
|||
/* Defer: Wait to the last minute to print help message */
|
||||
if (help)
|
||||
usage(h, argv[0]);
|
||||
/* Unless -D, set debug level to CLICON_DEBUG set
|
||||
* Only works for one value.
|
||||
*/
|
||||
{
|
||||
char *dstr;
|
||||
int d = 0;
|
||||
|
||||
dstr = clicon_option_str(h, "CLICON_DEBUG");
|
||||
if (dbg == 0 && dstr && strlen(dstr)){
|
||||
if ((d = clixon_debug_str2key(dstr)) < 0 &&
|
||||
sscanf(optarg, "%d", &d) != 1){
|
||||
clixon_err(OE_CFG, 0, "Parsing CLICON_DEBUG: %s", dstr);
|
||||
goto done;
|
||||
}
|
||||
clixon_debug_init(h, d);
|
||||
clixon_log_init(h, __PROGRAM__, d?LOG_DEBUG:LOG_INFO, logdst);
|
||||
}
|
||||
}
|
||||
|
||||
/* Split remaining argv/argc into <cmd> and <extra-options> */
|
||||
if (options_split(h, argv0, argc, argv, &restarg) < 0)
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ int cli_merge(clixon_handle h, cvec *vars, cvec *argv);
|
|||
int cli_create(clixon_handle h, cvec *vars, cvec *argv);
|
||||
int cli_remove(clixon_handle h, cvec *vars, cvec *argv);
|
||||
int cli_del(clixon_handle h, cvec *vars, cvec *argv);
|
||||
int cli_debug_show(clixon_handle h, cvec *cvv, cvec *argv);
|
||||
int cli_debug_cli(clixon_handle h, cvec *vars, cvec *argv);
|
||||
int cli_debug_backend(clixon_handle h, cvec *vars, cvec *argv);
|
||||
int cli_debug_restconf(clixon_handle h, cvec *vars, cvec *argv);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue