42 #include "EST_error.h"
43 #include "EST_ServiceTable.h"
44 #include "EST_FringeServer.h"
45 #include "EST_cmd_line.h"
80 int main(
int argc,
char *argv[])
90 "Summary: Send commands to a running fringe server.\n"
91 "use \"-\" to make input and output files stdin/out\n"
93 "-n <string> Name of fringe to connect to (default 'fringe').\n"
94 "-f <ifile> File containing fringe connection information.\n"
95 "-l List available fringe servers.\n"
96 "-v Print what is being done.\n",
109 name = al.
sval(
"-n");
119 switch (server.connect())
124 case connect_not_found_error:
125 EST_sys_error(
"Can't find host '%s:%d'", (
const char *)server.servername(), server.port());
128 case connect_not_allowed_error:
129 EST_sys_error(
"Can't connect to '%s:%d'", (
const char *)server.servername(), server.port());
133 EST_sys_error(
"Error connecting to '%s:%d'", (
const char *)server.servername(), server.port());
139 for(p.
begin(commands); p != 0; ++p)
147 if (server.parse_command(*p,
154 printf(
"command package='%s' operation='%s'\n",
155 (
const char *)package,
156 (
const char *)operation);
160 for (argp.
begin(args); argp != 0; ++argp)
161 printf(
"\t%10s%s%s\n",
162 (
const char *)argp->k,
163 argp->k==
""?
" : ":
" = ",
164 (
const char *)argp->v.String());
167 if (!server.execute(package,
171 EST_error(
"Error from Fringe: %s",
172 (
const char *)res.
S(
"ERROR"));
176 EST_error(
"badly formatted command '%s'", (
const char *)*p);