public boolean validate(final CommandLine input) {
        for(Option o : input.getOptions()) {
            if(Option.UNINITIALIZED == o.getArgs()) {
                continue;
            }
            if(o.hasOptionalArg()) {
                continue;
            }
            if(o.getArgs() != o.getValuesList().size()) {
                console.printf("Missing argument for option %s%n", o.getLongOpt());
                return false;
            }
        }
        final TerminalAction action = TerminalActionFinder.get(input);
        if(null == action) {
            console.printf("%s%n", "Missing argument");
            return false;
        }
        if(input.hasOption(TerminalOptionsBuilder.Params.existing.name())) {
            final String arg = input.getOptionValue(TerminalOptionsBuilder.Params.existing.name());
            if(null == TransferAction.forName(arg)) {
                final Set<TransferAction> actions = new HashSet<TransferAction>(TransferAction.forTransfer(Transfer.Type.download));
                actions.add(TransferAction.cancel);
                console.printf("Invalid argument '%s' for option %s. Must be one of %s%n",
                    arg, TerminalOptionsBuilder.Params.existing.name(), Arrays.toString(actions.toArray()));
                return false;
            }
            switch(action) {
                case download:
                    if(!validate(arg, Transfer.Type.download)) {
                        return false;
                    }
                    break;
                case upload:
                    if(!validate(arg, Transfer.Type.upload)) {
                        return false;
                    }
                    break;
                case synchronize:
                    if(!validate(arg, Transfer.Type.sync)) {
                        return false;
                    }
                    break;
                case copy:
                    if(!validate(arg, Transfer.Type.copy)) {
                        return false;
                    }
                    break;
            }
        }
        // Validate arguments
        switch(action) {
            case list:
            case download:
                if(!validate(input.getOptionValue(action.name()))) {
                    return false;
                }
                break;
            case upload:
            case copy:
            case synchronize:
                if(!validate(input.getOptionValue(action.name()))) {
                    return false;
                }
                break;
        }
        return true;
    }
@Test
    public void testColonInPath() throws Exception {
        final String uri = "rackspace://cdn.duck.sh/duck-4.6.2.16174:16179M.pkg";
        final Set<Protocol> list = new HashSet<>(Arrays.asList(
                new SwiftProtocol(),
                new ProfilePlistReader(new ProtocolFactory(Collections.singleton(new SwiftProtocol())))
                    .read(this.getClass().getResourceAsStream("/Rackspace US.cyberduckprofile"))
        ));
        assertTrue(new TerminalOptionsInputValidator(new ProtocolFactory(list)).validate(uri));
    }