static void Main(string[] args)
{
string endpoint = null;
if(args.Length > 0)
if (args[0] == "-e")
endpoint = args[1];
if (endpoint == null)
endpoint = ConfigurationManager.AppSettings["res"];
if(endpoint == null)
throw new ArgumentException("Usage: res.dira.exe -e endpoint, or use an app setting named res with the endpoint as the value");
Console.WriteLine("Hello...shall we try out the res server?");
Console.WriteLine("Starting client engine for {0}...", endpoint);
var engine = new ResPublishEngine(endpoint);
GlobalHack.SetEngine(engine);
Console.WriteLine("Client engine started.");
var cmdr = new CmdR("input>", new[] {"exit"});
cmdr.AutoRegisterCommands();
cmdr.Run(args);
engine.Dispose();
Console.WriteLine("Bye bye.");
}