summaryrefslogtreecommitdiffstats
path: root/src/core/settings.c
diff options
context:
space:
mode:
authorMichael Brown2006-08-11 20:40:27 +0200
committerMichael Brown2006-08-11 20:40:27 +0200
commit3c35a0b16de4b1251bc91318716436f5860f95e2 (patch)
treecf8600ae770ba8ee1345b2dbb2c33bcffcc2218e /src/core/settings.c
parentAdded "hostname" and "ip" as sample settings (diff)
downloadipxe-3c35a0b16de4b1251bc91318716436f5860f95e2.tar.gz
ipxe-3c35a0b16de4b1251bc91318716436f5860f95e2.tar.xz
ipxe-3c35a0b16de4b1251bc91318716436f5860f95e2.zip
Added cmdl_show proof-of-concept
Diffstat (limited to 'src/core/settings.c')
-rw-r--r--src/core/settings.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/settings.c b/src/core/settings.c
index 20247dcc..a7a708af 100644
--- a/src/core/settings.c
+++ b/src/core/settings.c
@@ -264,3 +264,23 @@ struct config_setting basic_config_settings[] __config_setting = {
.type = &config_setting_type_ipv4,
},
};
+
+
+
+/* Quick and dirty proof of concept */
+int cmdl_show ( int argc, char **argv ) {
+ char buf[256];
+ struct config_context dummy_context = { NULL };
+ int rc;
+
+ if ( argc < 2 )
+ return -EINVAL;
+
+ if ( ( rc = show_setting ( &dummy_context, argv[1],
+ buf, sizeof ( buf ) ) ) != 0 )
+ return rc;
+
+ printf ( "%s = %s\n", argv[1], buf );
+ return 0;
+}
+