Browse Source

Show default keys

Serj Kalichev 1 year ago
parent
commit
21c7c7ae67
2 changed files with 3 additions and 4 deletions
  1. 0 1
      src/pline.c
  2. 3 3
      src/show.c

+ 0 - 1
src/pline.c

@@ -732,7 +732,6 @@ static bool_t pline_parse_module(const struct lys_module *module, faux_argv_t *a
 						assert(key);
 						key->node = iter;
 						if ((key->dflt = klysc_node_ext_default(iter))) {
-syslog(LOG_ERR, "key dflt %s", key->dflt);
 							if (first_key)
 								first_key_is_optional = BOOL_TRUE;
 						}

+ 3 - 3
src/show.c

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