Added robust command line argument system to TestTool

Fixed FollowCommand so that it sorta works.

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@619 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
lonecoder
2006-11-22 08:20:02 +00:00
parent 3c78099ed5
commit c7fc80bb41
5 changed files with 1472 additions and 22 deletions

View File

@@ -2,23 +2,31 @@ using System;
using System.Collections.Generic;
using System.Text;
using CommandLine;
namespace libsecondlife.TestTool
{
class Program
public class Program
{
[Argument(ArgumentType.Required, HelpText="First name of the SL account to log in with.")]
public string FirstName;
[Argument(ArgumentType.Required, HelpText="Last name of the SL account to log in with.")]
public string LastName;
[Argument(ArgumentType.Required, HelpText="Password of the SL account to log in with.")]
public string Password;
[Argument(ArgumentType.AtMostOnce, HelpText="Full account name to recieve IM commands from.")]
public string MasterName;
static void Main(string[] args)
{
if (args.Length < 3)
{
Console.WriteLine("Usage: TestTool.exe firstname lastname password [Master Name]");
return;
}
Program program = new Program();
CommandLine.Parser.ParseArgumentsWithUsage(args, program);
string masterName = String.Empty;
for (int ct = 3; ct < args.Length;ct++)
masterName = masterName + args[ct] + " ";
TestTool testTool = new TestTool(args[0], args[1], args[2], masterName.TrimEnd());
TestTool testTool = new TestTool(program.FirstName, program.LastName, program.Password);
testTool.Master = program.MasterName;
testTool.Run();
}
}