ParsedArguments cmdLine = HELP_INFO.parse(args);  File dir = ARG_DIR.getFile(cmdLine); if (dir == null) { dir = new File(System.getProperty("user.dir")); }  if (dir.exists() && dir.isDirectory()) { final File[] list = dir.listFiles(); printList(list); } else if("/".equals(dir.getCanonicalPath())) { File[] roots = File.listRoots(); printList(roots); } else if (dir.exists() && dir.isFile()) { printList(new File[] { dir }); } else { System.err.println("No such directory " + dir); }
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);		File dir = ARG_DIR.getFile(cmdLine);		if (dir == null) {			dir = new File(System.getProperty("user.dir"));		}		if (dir.exists() && dir.isDirectory()) {			final File[] list = dir.listFiles();			printList(list);		} else if("/".equals(dir.getCanonicalPath())) {			File[] roots = File.listRoots();			printList(roots);		} else if (dir.exists() && dir.isFile()) {		    printList(new File[] { dir });		} else {			System.err.println("No such directory " + dir);		}	}