public static void main(String[] args)
	{
		if (args.length == 2)
		{
			File fileOrDir = new File(args[0]);
			File outputFile = new File(args[1]);
			
			try
			{
				if (fileOrDir.exists())
				{
					List<String> comments = new ArrayList<String>();
					File[] files;
					
					if (fileOrDir.isDirectory())
					{
						files = fileOrDir.listFiles(new FilenameFilter()
						{
							/**
							 * @see java.io.FilenameFilter#accept(java.io.File, java.lang.String)
							 */
							public boolean accept(File dir, String name)
							{
								return name.toLowerCase().endsWith(".js");
							}
						});
					}
					else
					{
						files = new File[] { fileOrDir };
					}
					
					if (outputFile.exists() == false)
					{
						if (outputFile.createNewFile() == false)
						{
							System.out.println("Unable to create output file: " + args[1]);
						}
					}
					
					if (outputFile.exists())
					{
						for (int i = 0; i < files.length; i++)
						{
							File file = files[i];
							
							comments.addAll(getComments(file));
						}
						
						FileWriter fw = new FileWriter(outputFile);
						BufferedWriter writer = new BufferedWriter(fw);
						
						for (int i = 0; i < comments.size() - 1; i++)
						{
							String comment = comments.get(i);
							
							writer.write(comment);
							writer.newLine();
							writer.newLine();
						}
						
						String comment = comments.get(comments.size() - 1);
						writer.write(comment);
						writer.newLine();
						
						writer.close();
					}
					
					System.out.println("Extraction complete");
				}
				else
				{
					System.out.println("Source file or directory does not exist: " + args[0]);
				}
			}
			catch (Exception e)
			{
				System.out.println("An error occurred: " + e.getMessage());
			}
		}
		else
		{
			System.out.println("usage: Extract (<old-directory> | <old-file>) <output-file>");
			System.out.println();
			System.out.println("<old-directory>    contains JS files with SDOC comments to be");
			System.out.println("                   extracted. This does not recursively descend");
			System.out.println("                   into all directories. Only files in the directory");
			System.out.println("                   itself will be processed");
			System.out.println("<old-file>         A JS file with SDOC comments to be extracted");
			System.out.println("<output-file>      The file where all SDOC comments will be placed");
		}
	}