final ParsedArguments cmdLine = HELP_INFO.parse(args); final URL url = openURL(ARG_FILE.getValue(cmdLine)); final InputStream is = url.openStream(); if (is == null) { System.err.println("Not found " + ARG_FILE.getValue(cmdLine)); } else { int len; final byte[] buf = new byte[ 1024]; while ((len = is.read(buf)) > 0) { System.out.write(buf, 0, len); } System.out.flush(); is.close(); }
new CatCommand().execute(new CommandLine(args), System.in, System.out, System.err);
    public static void main(String[] args) throws Exception {        final ParsedArguments cmdLine = HELP_INFO.parse(args);        final URL url = openURL(ARG_FILE.getValue(cmdLine));        final InputStream is = url.openStream();        if (is == null) {            System.err.println("Not found " + ARG_FILE.getValue(cmdLine));        } else {            int len;            final byte[] buf = new byte[ 1024];            while ((len = is.read(buf)) > 0) {                System.out.write(buf, 0, len);            }            System.out.flush();            is.close();        }    }