public static void Main(string[] args)
{
Console.WriteLine("Golem (Beta) 2008\nYour friendly executable .NET build tool. \n");
IList<Recipe> found;
RecipeCataloger finder = CreateCataloger(out found);
if(args.Length > 0)
{
if(args[0] == "-T")
{
ShowList(found);
return;
}
else if(args[0].ToLower() == "-?")
{
Console.WriteLine("Help: \n");
Console.WriteLine("golem -T # List build tasks");
Console.WriteLine("golem -? # Show this help");
Console.WriteLine("golem -? # Show this help");
return;
}
var parts = args[0].Split(':');
var runner = new TaskRunner(finder);
if(parts.Length == 2 && args.Length == 1)
{
runner.Run(parts[0],parts[1]);
}
else if(parts.Length ==2 && args.Length > 1)
{
//TODO: Tidy this up and refactor
var dest = new string[args.Length-1];
Array.Copy(args,1,dest,0,args.Length-1);
runner.Run(parts[0],parts[1],dest);
}
else
{
Console.WriteLine("Type golem -? for help, or try one of the following tasks:\n");
ShowList(found);
}
}
else
{
ShowList(found);
}
}