# conf2struct for echosrv

header: "echosrv-conf.h";
parser: "echosrv-conf.c";

printer: true;

conffile_option: ("F", "config");

config: {
          name: "echocfg",
          type: "list",
          items: (
                  {name: "udp", type: "bool"; default: false; },
                  {name: "prefix", type: "string"; },
              { name: "listen", 
                type: "list", 
                items: (
                        { name: "host"; type: "string"; var: true; },
                        { name: "port"; type: "string"; var: true; }
                    )
                }
            )
}


cl_groups: (
    { name: "listen"; pattern: "(.+):(\w+)"; description: "Listen on host:port";
      short: "p"; argdesc: "<host:port>";
        list: "listen";
        # no override, this just adds to the list (and thus can be specified several times)
        targets: (
        { path: "host"; value: "$1" },
        { path: "port"; value: "$2" }
        );
    }
)