summaryrefslogtreecommitdiff
path: root/c_conf_gen/config
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2015-02-17 20:00:33 +0900
committerFreeArtMan <dos21h@gmail.com>2015-02-17 20:00:33 +0900
commit670e03997afca107abbfc61a61f89477a9f9ab82 (patch)
treedc6b31a985104ef1180859780379408e1abdb215 /c_conf_gen/config
parent35a421a727841319d5a998806924205ec6663bc2 (diff)
downloadcode-snippets-670e03997afca107abbfc61a61f89477a9f9ab82.tar.gz
code-snippets-670e03997afca107abbfc61a61f89477a9f9ab82.zip
c_conf_gen lua script that generates getopt code for fast argc,argv parsing. for lazy people
Diffstat (limited to 'c_conf_gen/config')
-rw-r--r--c_conf_gen/config/cs_config1.lua9
-rw-r--r--c_conf_gen/config/cs_config2.lua33
-rw-r--r--c_conf_gen/config/cs_config3.lua0
3 files changed, 42 insertions, 0 deletions
diff --git a/c_conf_gen/config/cs_config1.lua b/c_conf_gen/config/cs_config1.lua
new file mode 100644
index 0000000..3069bd3
--- /dev/null
+++ b/c_conf_gen/config/cs_config1.lua
@@ -0,0 +1,9 @@
+--config for empty config parsing file
+
+local M = {}
+
+M.project_name = "HelloWorld"
+M.params_list = nil
+
+
+return M \ No newline at end of file
diff --git a/c_conf_gen/config/cs_config2.lua b/c_conf_gen/config/cs_config2.lua
new file mode 100644
index 0000000..9646834
--- /dev/null
+++ b/c_conf_gen/config/cs_config2.lua
@@ -0,0 +1,33 @@
+--config for empty config parsing file
+
+TYPE_INT = 1
+TYPE_STR = 2
+TYPE_FILE = 3
+
+local M = {}
+
+M.project_name = "INT_STR_FILE"
+M.params_list = {}
+
+param1 = {
+ type = TYPE_INT,
+ name = "number",
+ shortopt = "i:"
+}
+M.params_list[1] = param1
+
+param2 = {
+ type = TYPE_STR,
+ name = "username",
+ shortopt = "s:"
+}
+M.params_list[2] = param2
+
+param3 = {
+ type = TYPE_FILE,
+ name = "configfile",
+ shortopt = "f:"
+}
+M.params_list[3] = param3
+
+return M \ No newline at end of file
diff --git a/c_conf_gen/config/cs_config3.lua b/c_conf_gen/config/cs_config3.lua
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/c_conf_gen/config/cs_config3.lua