Преглед на файлове

MultiKeysWithStatement -> KeysWithStatement

Serj Kalichev преди 1 година
родител
ревизия
b7b4efc88d
променени са 5 файла, в които са добавени 12 реда и са изтрити 10 реда
  1. 3 2
      src/pline.c
  2. 1 1
      src/pline.h
  3. 4 4
      src/plugin.c
  4. 3 2
      src/show.c
  5. 1 1
      xml/sysrepo.xml

+ 3 - 2
src/pline.c

@@ -641,8 +641,9 @@ static bool_t pline_parse_module(const struct lys_module *module, faux_argv_t *a
 					assert (leaf->type->basetype != LY_TYPE_EMPTY);
 
 					// Parse statement if necessary
-					if ((first_key && opts->first_key_w_stmt) ||
-						(!first_key && opts->multi_keys_w_stmt)) {
+					if (opts->keys_w_stmt &&
+						(!first_key ||
+						(first_key && opts->first_key_w_stmt))) {
 						// Completion
 						if (!str) {
 							pline_add_compl(pline,

+ 1 - 1
src/pline.h

@@ -117,7 +117,7 @@ typedef struct {
 	bool_t show_brackets;
 	bool_t show_semicolons;
 	bool_t first_key_w_stmt;
-	bool_t multi_keys_w_stmt;
+	bool_t keys_w_stmt;
 	bool_t colorize;
 	uint8_t indent;
 	bool_t default_keys;

+ 4 - 4
src/plugin.c

@@ -95,7 +95,7 @@ int kplugin_sysrepo_init(kcontext_t *context)
 	udata->opts.show_brackets = BOOL_TRUE;
 	udata->opts.show_semicolons = BOOL_TRUE;
 	udata->opts.first_key_w_stmt = BOOL_FALSE;
-	udata->opts.multi_keys_w_stmt = BOOL_TRUE;
+	udata->opts.keys_w_stmt = BOOL_TRUE;
 	udata->opts.colorize = BOOL_TRUE;
 	udata->opts.indent = 2;
 	udata->opts.default_keys = BOOL_FALSE;
@@ -205,11 +205,11 @@ static int parse_plugin_conf(const char *conf, pline_opts_t *opts)
 			opts->first_key_w_stmt = BOOL_FALSE;
 	}
 
-	if ((val = faux_ini_find(ini, "MultiKeysWithStatement"))) {
+	if ((val = faux_ini_find(ini, "KeysWithStatement"))) {
 		if (faux_str_cmp(val, "y") == 0)
-			opts->multi_keys_w_stmt = BOOL_TRUE;
+			opts->keys_w_stmt = BOOL_TRUE;
 		else if (faux_str_cmp(val, "n") == 0)
-			opts->multi_keys_w_stmt = BOOL_FALSE;
+			opts->keys_w_stmt = BOOL_FALSE;
 	}
 
 	if ((val = faux_ini_find(ini, "Colorize"))) {

+ 3 - 2
src/show.c

@@ -202,8 +202,9 @@ static void show_list(const struct lyd_node *node, size_t level,
 			continue;
 		if (!(iter->schema->flags & LYS_KEY))
 			continue;
-		if ((first_key && opts->first_key_w_stmt) ||
-			(!first_key && opts->multi_keys_w_stmt))
+		if (opts->keys_w_stmt &&
+			(!first_key ||
+			(first_key && opts->first_key_w_stmt)))
 			printf(" %s", iter->schema->name);
 		value = get_value(iter);
 		printf(" %s", value);

+ 1 - 1
xml/sysrepo.xml

@@ -7,8 +7,8 @@
 <PLUGIN name="sysrepo">
 	ShowBrackets = y
 	ShowSemicolons = y
+	KeysWithStatement = y
 	FirstKeyWithStatement = n
-	MultiKeysWithStatement = y
 	Colorize = y
 	Indent = 2
 	DefaultKeys = n