Move name exceptions into the txt file.
authorWayne Davison <wayne@opencoder.net>
Wed, 1 Jul 2020 16:05:21 +0000 (09:05 -0700)
committerWayne Davison <wayne@opencoder.net>
Wed, 1 Jul 2020 16:05:21 +0000 (09:05 -0700)
daemon-parm.awk
daemon-parm.txt

index 8fc4c237c438782861b5130c17ad4665dbe45785..0166a9e331d364d61ced8ccc2bb72aaa3df5380d 100755 (executable)
@@ -69,16 +69,12 @@ BEGIN {
        vtype = "int"
     }
 
-    # We have 2 variables that don't match their conf string. Oh well...
-    if (name == "bind_address")
-       spname = "address"
-    else if (name == "rsync_port")
-       spname = "port"
-    else {
-       spname = name
-       gsub(/_/, " ", spname)
-       gsub(/-/, "", name)
-    }
+    # The name might be var_name|public_name
+    pubname = name
+    sub(/\|.*/, "", name)
+    sub(/.*\|/, "", pubname)
+    gsub(/_/, " ", pubname)
+    gsub(/-/, "", name)
 
     if (ptype == "ENUM")
        enum = "enum_" name
@@ -87,7 +83,7 @@ BEGIN {
 
     defines = defines "\t" vtype " " name ";\n"
     values = values "\t" $0 ", /* " name " */\n"
-    params = params " {\"" spname "\", P_" ptype psect name ", " enum ", 0},\n"
+    params = params " {\"" pubname "\", P_" ptype psect name ", " enum ", 0},\n"
     accessors = accessors "FN_" sect "_" atype "(lp_" name ", " name ")\n"
 
     if (vtype == "char*") {
index 36ae51152bc79a2a2a9d0237aad0b283b292f7e3..83ecc980e5481ffccaa319f390768dec03fceea6 100644 (file)
@@ -1,6 +1,6 @@
 Globals: ================================================================
 
-STRING bind_address            NULL
+STRING bind_address|address    NULL
 STRING daemon_chroot           NULL
 STRING daemon_gid              NULL
 STRING daemon_uid              NULL
@@ -9,7 +9,7 @@ STRING  pid_file                NULL
 STRING socket_options          NULL
 
 INTEGER        listen_backlog          5
-INTEGER        rsync_port              0
+INTEGER        rsync_port|port         0
 
 BOOL   proxy_protocol          False