瀏覽代碼

Show default keys

Serj Kalichev 1 年之前
父節點
當前提交
21c7c7ae67
共有 2 個文件被更改,包括 3 次插入4 次删除
  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);