@DefaultCommand public void run( @Option(description = "The new directory", defaultValue = "~") final Resource<?>[] dirs) throws IOException { Resource<?> r = null; for (Resource<?> dir : dirs) { r = dir; } if (r != null) { if (!r.exists()) { throw new RuntimeException("no such resource: " + r.toString()); } shell.setCurrentResource(r); } }