Ejemplo n.º 1
0
        public virtual void TestSimpleIntPresent()
        {
            var args = new com.cleancoder.args.Args("x#", new string[] { "-x", "42" });

            Assert.True(args.has('x'));
            Assert.Equal(42, args.getInt('x'));
            Assert.Equal(2, args.nextArgument());
        }
Ejemplo n.º 2
0
 static void Main(string[] args)
 {
     try
     {
         var    arg       = new Args("l,p#,d*", args);
         bool   logging   = arg.getBoolean('l');
         int    port      = arg.getInt('p');
         string directory = arg.getString('d');
         ExecuteApplication(logging, port, directory);
     }
     catch (ArgsException e)
     {
         Console.Write("Argument error: {0}\n", e.errorMessage());
         Console.ReadKey();
     }
 }