Browse Source

Fix plugin installation path. Fix double free. Add xml

Serj Kalichev 1 year ago
parent
commit
2ada525f72
4 changed files with 44 additions and 5 deletions
  1. 1 1
      configure.ac
  2. 1 1
      src/Makefile.am
  3. 1 3
      src/syms.c
  4. 41 0
      xml/sysrepo.xml

+ 1 - 1
configure.ac

@@ -80,7 +80,7 @@ AM_CONDITIONAL(DEBUG,test x$enable_debug = xyes)
 ################################
 # Variables to install plugins
 ################################
-PLUGINS_SUBDIR=plugins
+PLUGINS_SUBDIR=klish/plugins
 AC_SUBST(PLUGINS_SUBDIR)
 
 

+ 1 - 1
src/Makefile.am

@@ -1,4 +1,4 @@
-plugindir = ${pkglibdir}/@PLUGINS_SUBDIR@
+plugindir = ${libdir}/@PLUGINS_SUBDIR@
 plugin_LTLIBRARIES =
 
 plugin_LTLIBRARIES += kplugin-sysrepo.la

+ 1 - 3
src/syms.c

@@ -73,10 +73,8 @@ int srp_compl(kcontext_t *context)
 	faux_argv_del_continuable(args);
 	pline = pline_parse(sess, args, 0);
 	faux_argv_free(args);
-	pline_print_completions(pline, BOOL_TRUE);
+	pline_print_completions(pline, BOOL_FALSE);
 	pline_free(pline);
 
-	faux_argv_free(args);
-
 	return 0;
 }

+ 41 - 0
xml/sysrepo.xml

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<KLISH
+	xmlns="http://clish.sourceforge.net/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://clish.sourceforge.net/XMLSchema http://clish.sourceforge.net/XMLSchema/clish.xsd">
+
+<PLUGIN name="sysrepo"/>
+
+
+<ENTRY name="PLINE" purpose="ptype">
+	<ENTRY name="completion" purpose="completion">
+		<ACTION sym="srp_compl@sysrepo"/>
+	</ENTRY>
+<!--	<ENTRY name="help" purpose="help">
+		<ACTION sym="completion_COMMAND"/>
+	</ENTRY>
+-->	<ACTION sym="STRING"/>
+</ENTRY>
+
+
+<ENTRY name="sysrepo" mode="switch" container="true">
+
+<!--
+<ENTRY name="exit" help="Exit view">
+	<ENTRY name="COMMAND" purpose="ptype" ref="/COMMAND"/>
+	<ACTION sym="nav">pop</ACTION>
+	<ACTION sym="print">Exiting klish session</ACTION>
+</ENTRY>
+-->
+
+<ENTRY name="set" help="Clear settings" mode="sequence">
+	<ENTRY name="COMMAND" purpose="ptype" ref="/COMMAND"/>
+	<ENTRY name="path" help="Clear settings" max="100">
+		<ENTRY name="PLINE" purpose="ptype" ref="/PLINE"/>
+	</ENTRY>
+	<ACTION sym="print">test</ACTION>
+</ENTRY>
+
+</ENTRY>
+
+</KLISH>