ParsedArguments cmdLine = HELP_INFO.parse(args);  final File dir = ARG_DIR.getFile(cmdLine); if (dir.exists() && dir.isDirectory()) { System.setProperty("user.dir", dir.getAbsoluteFile().getCanonicalPath()); } else if("/".equals(dir.getCanonicalPath())) { System.getProperties().setProperty("user.dir", "/"); } else { System.err.println(dir + " is not a valid directory"); }
new DirCommand().execute(new CommandLine(args), System.in, System.out, System.err);
	public static void main(String[] args) throws Exception {		ParsedArguments cmdLine = HELP_INFO.parse(args);		final File dir = ARG_DIR.getFile(cmdLine);		if (dir.exists() && dir.isDirectory()) {			System.setProperty("user.dir", dir.getAbsoluteFile().getCanonicalPath());		} else if("/".equals(dir.getCanonicalPath())) {			System.getProperties().setProperty("user.dir", "/");		} else {			System.err.println(dir + " is not a valid directory");		}	}