[svn] r5967: nemerle/trunk/ncc/testsuite/completion-playground/compl.n

nazgul svnadmin at nemerle.org
Wed Nov 23 19:05:11 CET 2005


Log:
Add check for no arguments (by Hendrik Krauss)

Author: nazgul
Date: Wed Nov 23 19:05:06 2005
New Revision: 5967

Modified:
   nemerle/trunk/ncc/testsuite/completion-playground/compl.n

Modified: nemerle/trunk/ncc/testsuite/completion-playground/compl.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/completion-playground/compl.n	(original)
+++ nemerle/trunk/ncc/testsuite/completion-playground/compl.n	Wed Nov 23 19:05:06 2005
@@ -7,7 +7,15 @@
 def engine = Engine ();
 
 def files = Hashtable ();
-def args = List.FromArray (System.Environment.GetCommandLineArgs ()).Tail;
+def rawArgs = List.FromArray (System.Environment.GetCommandLineArgs ());
+def (progName, args) = rawArgs.Head::rawArgs.Tail;
+when (args.Length == 0) {
+	WriteLine($"usage: $progName <filename>\n"+
+		       "       <filename> is the Nemerle source code you want "+
+	           "to pass to the \n"+
+	           "       code completion engine");
+	System.Environment.Exit(1);
+}
 foreach (arg in args) {
   using (sr = StreamReader (arg)) {
     def str = sr.ReadToEnd ();



More information about the svn mailing list