mustang/toecount/src/main/java/toecount/Toecount.java
public static void main(String[] args) {
		CmdLineParser parser = new CmdLineParser();
		Option<String> dirnameOption = parser.addStringOption('d', "directory");
		Option<Boolean> filesFromStdInOption = parser.addBooleanOption('l',
				"listfromstdin");
		Option<Boolean> ignoreFileExtOption = parser.addBooleanOption('i',
				"ignorefileextension");
		Option<Boolean> helpOption = parser.addBooleanOption('h',
				"help");

		if (args.length==0) {
			printUsage();
			System.exit(2);
			
		}
		try {
			parser.parse(args);
		} catch (CmdLineParser.OptionException e) {
			System.err.println(e.getMessage());
			printUsage();
			System.exit(2);
		}

		String directoryName = parser.getOptionValue(dirnameOption);

		Boolean filesFromStdIn = parser.getOptionValue(filesFromStdInOption,
				Boolean.FALSE);
		
		Boolean helpRequested = parser.getOptionValue(helpOption,
				Boolean.FALSE);

		Boolean ignoreFileExt  = parser.getOptionValue(ignoreFileExtOption,
				Boolean.FALSE);
		
		if (helpRequested) {
			printHelp();
		}

		StatRun sr=new StatRun();
		if (ignoreFileExt) { 
			sr.ignoreFileExtension();
		}
		if (directoryName != null) {
			Path startingDir = Paths.get(directoryName);

			if (Files.isRegularFile(startingDir)) {
				String filename = startingDir.toString();
				FileChecker fc = new FileChecker(filename, sr);
				
				fc.checkForZUGFeRD();
				System.out.print(fc.getOutputLine());

			} else if (Files.isDirectory(startingDir)) {
				FileTraverser pf = new FileTraverser(sr);
				try {
					Files.walkFileTree(startingDir, pf);
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}

			}

		}

		if (filesFromStdIn) {
			  BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			    String s;
			    try {
					while ((s = in.readLine()) != null && s.length() != 0) {
						FileChecker fc = new FileChecker(s, sr);
						
						fc.checkForZUGFeRD();
						System.out.print(fc.getOutputLine());
					  
					}
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}

		}
		System.out.println(sr.getSummaryLine());
	}
// /opt/local/bin/mvn clean compile assembly:single
opt/local/bin/mvn clean compile assembly:single
opt / local / bin / mvn clean compile assembly : single
public static void main(String[] args) {
		CmdLineParser parser = new CmdLineParser();
		Option<String> dirnameOption = parser.addStringOption('d', "directory");
		Option<Boolean> filesFromStdInOption = parser.addBooleanOption('l',
				"listfromstdin");
		Option<Boolean> ignoreFileExtOption = parser.addBooleanOption('i',
				"ignorefileextension");
		Option<Boolean> helpOption = parser.addBooleanOption('h',
				"help");
		if (args.length==0) {
			printUsage();
			System.exit(2);
		}
		try {
			parser.parse(args);
		} catch (CmdLineParser.OptionException e) {
			System.err.println(e.getMessage());
			printUsage();
			System.exit(2);
		}
		String directoryName = parser.getOptionValue(dirnameOption);
		Boolean filesFromStdIn = parser.getOptionValue(filesFromStdInOption,
				Boolean.FALSE);
		Boolean helpRequested = parser.getOptionValue(helpOption,
				Boolean.FALSE);
		Boolean ignoreFileExt  = parser.getOptionValue(ignoreFileExtOption,
				Boolean.FALSE);
		if (helpRequested) {
			printHelp();
		}
		StatRun sr=new StatRun();
		if (ignoreFileExt) { 
			sr.ignoreFileExtension();
		}
		if (directoryName != null) {
			Path startingDir = Paths.get(directoryName);
			if (Files.isRegularFile(startingDir)) {
				String filename = startingDir.toString();
				FileChecker fc = new FileChecker(filename, sr);
				fc.checkForZUGFeRD();
				System.out.print(fc.getOutputLine());
			} else if (Files.isDirectory(startingDir)) {
				FileTraverser pf = new FileTraverser(sr);
				try {
					Files.walkFileTree(startingDir, pf);
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
		if (filesFromStdIn) {
			  BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			    String s;
			    try {
					while ((s = in.readLine()) != null && s.length() != 0) {
						FileChecker fc = new FileChecker(s, sr);
						fc.checkForZUGFeRD();
						System.out.print(fc.getOutputLine());
					}
				} catch (IOException e) {
					e.printStackTrace();
				}
		}
		System.out.println(sr.getSummaryLine());
	}
public static void main ( String [ ] args ) { CmdLineParser parser = new CmdLineParser ( ) ; Option < String > dirnameOption = parser . addStringOption ( 'd' , "directory" ) ; Option < Boolean > filesFromStdInOption = parser . addBooleanOption ( 'l' , "listfromstdin" ) ; Option < Boolean > ignoreFileExtOption = parser . addBooleanOption ( 'i' , "ignorefileextension" ) ; Option < Boolean > helpOption = parser . addBooleanOption ( 'h' , "help" ) ; if ( args . length == 0 ) { printUsage ( ) ; System . exit ( 2 ) ; } try { parser . parse ( args ) ; } catch ( CmdLineParser . OptionException e ) { System . err . println ( e . getMessage ( ) ) ; printUsage ( ) ; System . exit ( 2 ) ; } String directoryName = parser . getOptionValue ( dirnameOption ) ; Boolean filesFromStdIn = parser . getOptionValue ( filesFromStdInOption , Boolean . FALSE ) ; Boolean helpRequested = parser . getOptionValue ( helpOption , Boolean . FALSE ) ; Boolean ignoreFileExt = parser . getOptionValue ( ignoreFileExtOption , Boolean . FALSE ) ; if ( helpRequested ) { printHelp ( ) ; } StatRun sr = new StatRun ( ) ; if ( ignoreFileExt ) { sr . ignoreFileExtension ( ) ; } if ( directoryName != null ) { Path startingDir = Paths . get ( directoryName ) ; if ( Files . isRegularFile ( startingDir ) ) { String filename = startingDir . toString ( ) ; FileChecker fc = new FileChecker ( filename , sr ) ; fc . checkForZUGFeRD ( ) ; System . out . print ( fc . getOutputLine ( ) ) ; } else if ( Files . isDirectory ( startingDir ) ) { FileTraverser pf = new FileTraverser ( sr ) ; try { Files . walkFileTree ( startingDir , pf ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } if ( filesFromStdIn ) { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s ; try { while ( ( s = in . readLine ( ) ) != null && s . length ( ) != 0 ) { FileChecker fc = new FileChecker ( s , sr ) ; fc . checkForZUGFeRD ( ) ; System . out . print ( fc . getOutputLine ( ) ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } } System . out . println ( sr . getSummaryLine ( ) ) ; }
opt/local/bin/mvn clean compile assembly:single
opt / local / bin / mvn clean compile assembly : single
// TODO Auto-generated catch block // TODO Auto-generated catch block