code: public static void main(String[] args)
     {
        boolean quiet = false;
        String outputDir = "."; //put report into current directory by default
        int arg = 0;
        String[] classpath = null;
        
        if (args.length > 0)
        {
           while (args.length > arg + 1)
           {
              if (args[arg].startsWith("-"))
              {
                 if (args[arg].endsWith("quiet"))
                 {
                    quiet = true;
                 }
                 else if (args[arg].endsWith("output"))
                 {
                    arg++;
                    if (arg + 1 >= args.length)
                    {
                       usage();
                       System.exit(OTHER);
                    }
                    outputDir = args[arg];
                 }
                 else if (args[arg].endsWith("classpath"))
                 {
                    arg++;
                    classpath = args[arg].split(System.getProperty("path.separator"));
  
                 }
              }
              else
              {
                 usage();
                 System.exit(OTHER);
              }
              arg++;
           }
  
           try
           {
              int systemExitCode = Validation.validate(new File(args[arg]).toURI().toURL(), outputDir, classpath);
              
              if (!quiet)
              {
                 if (systemExitCode == SUCCESS)
                 {
                    System.out.println("Validation sucessful");
                 }
                 else if (systemExitCode == FAIL)
                 {
                    System.out.println("Validation errors");
                 }
                 else if (systemExitCode == OTHER)
                 {
                    System.out.println("Validation unknown");
                 }
              }
  
              System.exit(systemExitCode);
           }
           catch (ArrayIndexOutOfBoundsException oe)
           {
              usage();
              System.exit(OTHER);
           }
           catch (MalformedURLException e)
           {
              e.printStackTrace();
           }
        }
        else
        {
           usage();
        }
           
        System.exit(SUCCESS);
     }
docs: Validator standalone tool
  
  @param args command line arguments