non-line scrolling mode in getline

This commit is contained in:
Olof hagsand 2017-09-24 16:58:27 +02:00
parent 41f30efce9
commit 229ddcf5cc
5 changed files with 15 additions and 0 deletions

View file

@ -1,5 +1,8 @@
# Clixon CHANGELOG # Clixon CHANGELOG
* Support for non-line scrolling in CLI, eg wrap lines. Set with:
CLICON_CLI_LINESCROLLING 0
## 3.3.2 Aug 27 2017 ## 3.3.2 Aug 27 2017
### Known issues ### Known issues

View file

@ -146,6 +146,9 @@ cli_syntax_set(clicon_handle h,
cli_syntax_t *stx) cli_syntax_t *stx)
{ {
struct cli_handle *cl = handle(h); struct cli_handle *cl = handle(h);
if (cl->cl_stx)
free(cl->cl_stx);
cl->cl_stx = stx; cl->cl_stx = stx;
return 0; return 0;
} }

View file

@ -392,6 +392,7 @@ main(int argc, char **argv)
cli_plugin_start(h, argc+1, argv-1); cli_plugin_start(h, argc+1, argv-1);
*(argv-1) = tmp; *(argv-1) = tmp;
cligen_line_scrolling_set(cli_cligen(h), clicon_option_int(h,"CLICON_CLI_LINESCROLLING"));
/* Launch interfactive event loop, unless -1 */ /* Launch interfactive event loop, unless -1 */
if (restarg != NULL && strlen(restarg)){ if (restarg != NULL && strlen(restarg)){
char *mode = cli_syntax_mode(h); char *mode = cli_syntax_mode(h);

View file

@ -119,6 +119,10 @@ CLICON_XMLDB_PLUGIN libdir/xmldb/text.so
# Dont include keys in cvec in cli vars callbacks, ie a & k in 'a <b> k <c>' ignored # Dont include keys in cvec in cli vars callbacks, ie a & k in 'a <b> k <c>' ignored
# CLICON_CLI_VARONLY 1 # CLICON_CLI_VARONLY 1
# Set to 0 if you want CLI to wrap to next line.
# Set to 1 if you want CLI to scroll sideways when approaching right margin
# CLICON_CLI_LINESCROLLING 1
# FastCGI unix socket. Should be specified in webserver # FastCGI unix socket. Should be specified in webserver
# Eg in nginx: fastcgi_pass unix:/www-data/clicon_restconf.sock; # Eg in nginx: fastcgi_pass unix:/www-data/clicon_restconf.sock;
CLICON_RESTCONF_PATH /www-data/fastcgi_restconf.sock CLICON_RESTCONF_PATH /www-data/fastcgi_restconf.sock

View file

@ -32,3 +32,7 @@ CLICON_USE_STARTUP_CONFIG 0
# XMLDB datastore plugin filename (see datastore/ and clixon_xml_db.[ch]) # XMLDB datastore plugin filename (see datastore/ and clixon_xml_db.[ch])
CLICON_XMLDB_PLUGIN /usr/local/lib/xmldb/text.so CLICON_XMLDB_PLUGIN /usr/local/lib/xmldb/text.so
#CLICON_XMLDB_PLUGIN /usr/local/lib/xmldb/keyvalue.so #CLICON_XMLDB_PLUGIN /usr/local/lib/xmldb/keyvalue.so
# Set to 0 if you want CLI to wrap to next line.
# Set to 1 if you want CLI to scroll sideways when approaching right margin
CLICON_CLI_LINESCROLLING 0