42 #include "EST_error.h"
43 #include "EST_ServiceTable.h"
44 #include "EST_FringeServer.h"
45 #include "EST_cmd_line.h"
47 int main(
int argc,
char *argv[])
57 "Summary: Send commands to a running fringe server.\n"
58 "use \"-\" to make input and output files stdin/out\n"
60 "-n <string> Name of fringe to connect to (default 'fringe').\n"
61 "-f <ifile> File containing fringe connection information.\n"
62 "-l List available fringe servers.\n"
63 "-v Print what is being done.\n",
86 switch (server.connect())
91 case connect_not_found_error:
92 EST_sys_error(
"Can't find host '%s:%d'", (
const char *)server.servername(), server.port());
95 case connect_not_allowed_error:
96 EST_sys_error(
"Can't connect to '%s:%d'", (
const char *)server.servername(), server.port());
100 EST_sys_error(
"Error connecting to '%s:%d'", (
const char *)server.servername(), server.port());
106 for(p.
begin(commands); p != 0; ++p)
114 if (server.parse_command(*p,
121 printf(
"command package='%s' operation='%s'\n",
122 (
const char *)package,
123 (
const char *)operation);
127 for (argp.
begin(args); argp != 0; ++argp)
128 printf(
"\t%10s%s%s\n",
129 (
const char *)argp->k,
130 argp->k==
""?
" : ":
" = ",
131 (
const char *)argp->v.String());
134 if (!server.execute(package,
138 EST_error(
"Error from Fringe: %s",
139 (
const char *)res.
S(
"ERROR"));
143 EST_error(
"badly formatted command '%s'", (
const char *)*p);
A class providing mechanisms to talk to fringe.
const EST_String S(const EST_String &path) const
const EST_String & sval(const EST_String &rkey, int m=1) const
const int present(const K &rkey) const
Returns true if key is present.
static void list(ostream &s, const EST_String type)
List the table to given stream.
static void read_table(void)
Read the users default table. ~/.estServices
void begin(const Container &over)
Set the iterator ready to run over this container.