Browse Source

Added cmdl_show proof-of-concept

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
3c35a0b16d
1 changed files with 20 additions and 0 deletions
  1. 20
    0
      src/core/settings.c

+ 20
- 0
src/core/settings.c View File

@@ -264,3 +264,23 @@ struct config_setting basic_config_settings[] __config_setting = {
264 264
 		.type = &config_setting_type_ipv4,
265 265
 	},
266 266
 };
267
+
268
+
269
+
270
+/* Quick and dirty proof of concept */
271
+int cmdl_show ( int argc, char **argv ) {
272
+	char buf[256];
273
+	struct config_context dummy_context = { NULL };
274
+	int rc;
275
+
276
+	if ( argc < 2 )
277
+		return -EINVAL;
278
+	
279
+	if ( ( rc = show_setting ( &dummy_context, argv[1],
280
+				   buf, sizeof ( buf ) ) ) != 0 )
281
+		return rc;
282
+
283
+	printf ( "%s = %s\n", argv[1], buf );
284
+	return 0;
285
+}
286
+

Loading…
Cancel
Save