From: <dri...@us...> - 2004-07-17 11:20:24
|
Update of /cvsroot/nantcontrib/NAntContrib/Tools/SLiNgshoT/SLiNgshoT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15792 Modified Files: Main.cs Log Message: tabs to spaces Index: Main.cs =================================================================== RCS file: /cvsroot/nantcontrib/NAntContrib/Tools/SLiNgshoT/SLiNgshoT/Main.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Main.cs 9 Jul 2002 21:59:15 -0000 1.1 --- Main.cs 17 Jul 2004 11:20:15 -0000 1.2 *************** *** 24,128 **** class SLiNgshoT_Console { ! static void Main(string[] args) ! { ! if (args.Length < 1) ! { ! WriteUsage(); ! } ! else ! { ! string format; ! string solution; ! Hashtable parameters = new Hashtable(); ! Hashtable uriMap = new Hashtable(); ! Driver.ParseArgs(args, out format, out solution, parameters, uriMap); ! if (format == null) ! { ! Console.Error.WriteLine("no output format specified"); ! } ! else ! { ! if (solution == null) ! { ! solution = Driver.FindSolution(Environment.CurrentDirectory); ! } ! SolutionWriter writer = null; ! switch (format) ! { ! case "nant": ! writer = new NAntWriter(); ! break; ! case "nmake": ! writer = new NMakeWriter(); ! break; ! } ! if (writer == null) ! { ! Console.Error.WriteLine("{0} is an unsupported format.", format); ! } ! else ! { ! Driver.WriteSolution(writer, Console.Out, solution, parameters, uriMap); ! } ! } ! } ! } ! private static void WriteUsage() ! { ! Console.Error.WriteLine("usage: SLiNgshoT <format> [-sln solution] [-map uri-prefix file-prefix]* [name=value]*"); ! Console.Error.WriteLine(); ! Console.Error.Write("formats: "); ! IList outputFormats = Driver.GetOutputFormats(); ! bool first = true; ! foreach (string format in outputFormats) ! { ! if (!first) ! { ! Console.Error.Write(", "); ! } ! else ! { ! first = false; ! } ! Console.Error.Write("-" + format); ! } ! Console.Error.WriteLine(); ! Console.Error.WriteLine(); ! Console.Error.WriteLine("if -sln is not specified, uses the only .sln file in the current directory"); ! Console.Error.WriteLine(); ! Console.Error.WriteLine("parameters:"); ! foreach (string format in outputFormats) ! { ! OutputParameterAttribute[] outputParameters = Driver.GetOutputParameters(format); ! if (outputParameters.Length > 0) ! { ! Console.Error.WriteLine(" {0}:", format); ! foreach (OutputParameterAttribute outputParameter in outputParameters) ! { ! Console.Error.WriteLine( ! " {0}: {2} ({1})", ! outputParameter.Name, ! outputParameter.Required ? "REQUIRED" : "OPTIONAL", ! outputParameter.Description); ! } ! } ! } ! Console.Error.WriteLine(); ! Console.Error.WriteLine("examples:"); ! Console.Error.WriteLine(" SLiNgshoT -nant build.basedir=..\\..\\bin"); ! Console.Error.WriteLine(" SLiNgshoT -nmake -sln Example.sln -map http://localhost/ C:\\Inetpub\\wwwroot\\"); ! } } --- 24,128 ---- class SLiNgshoT_Console { ! static void Main(string[] args) ! { ! if (args.Length < 1) ! { ! WriteUsage(); ! } ! else ! { ! string format; ! string solution; ! Hashtable parameters = new Hashtable(); ! Hashtable uriMap = new Hashtable(); ! Driver.ParseArgs(args, out format, out solution, parameters, uriMap); ! if (format == null) ! { ! Console.Error.WriteLine("no output format specified"); ! } ! else ! { ! if (solution == null) ! { ! solution = Driver.FindSolution(Environment.CurrentDirectory); ! } ! SolutionWriter writer = null; ! switch (format) ! { ! case "nant": ! writer = new NAntWriter(); ! break; ! case "nmake": ! writer = new NMakeWriter(); ! break; ! } ! if (writer == null) ! { ! Console.Error.WriteLine("{0} is an unsupported format.", format); ! } ! else ! { ! Driver.WriteSolution(writer, Console.Out, solution, parameters, uriMap); ! } ! } ! } ! } ! private static void WriteUsage() ! { ! Console.Error.WriteLine("usage: SLiNgshoT <format> [-sln solution] [-map uri-prefix file-prefix]* [name=value]*"); ! Console.Error.WriteLine(); ! Console.Error.Write("formats: "); ! IList outputFormats = Driver.GetOutputFormats(); ! bool first = true; ! foreach (string format in outputFormats) ! { ! if (!first) ! { ! Console.Error.Write(", "); ! } ! else ! { ! first = false; ! } ! Console.Error.Write("-" + format); ! } ! Console.Error.WriteLine(); ! Console.Error.WriteLine(); ! Console.Error.WriteLine("if -sln is not specified, uses the only .sln file in the current directory"); ! Console.Error.WriteLine(); ! Console.Error.WriteLine("parameters:"); ! foreach (string format in outputFormats) ! { ! OutputParameterAttribute[] outputParameters = Driver.GetOutputParameters(format); ! if (outputParameters.Length > 0) ! { ! Console.Error.WriteLine(" {0}:", format); ! foreach (OutputParameterAttribute outputParameter in outputParameters) ! { ! Console.Error.WriteLine( ! " {0}: {2} ({1})", ! outputParameter.Name, ! outputParameter.Required ? "REQUIRED" : "OPTIONAL", ! outputParameter.Description); ! } ! } ! } ! Console.Error.WriteLine(); ! Console.Error.WriteLine("examples:"); ! Console.Error.WriteLine(" SLiNgshoT -nant build.basedir=..\\..\\bin"); ! Console.Error.WriteLine(" SLiNgshoT -nmake -sln Example.sln -map http://localhost/ C:\\Inetpub\\wwwroot\\"); ! } } |