Package org.tmatesoft.svn.cli

Examples of org.tmatesoft.svn.cli.AbstractSVNCommand


    public void run() throws SVNException {
        if (!getEnvironment().getArguments().isEmpty()) {
            for (Iterator commands = getEnvironment().getArguments().iterator(); commands.hasNext();) {
                String commandName = (String) commands.next();
                AbstractSVNCommand command = AbstractSVNCommand.getCommand(commandName);
                if (command == null) {
                    getEnvironment().getErr().println("\"" + commandName + "\": unknown command.\n");
                    continue;
                }
                String help = SVNCommandUtil.getCommandHelp(command, getEnvironment().getProgramName(), false);
                getEnvironment().getOut().println(help);
            }
        } else if (getSVNDumpFilterEnvironment().isVersion()) {
            String version = SVNCommandUtil.getVersion(getEnvironment(), getSVNDumpFilterEnvironment().isQuiet());
            getEnvironment().getOut().println(version);
        } else if (getEnvironment().getArguments().isEmpty()) {
            Comparator commandComparator = new Comparator() {
                public int compare(Object o1, Object o2) {
                    AbstractSVNCommand c1 = (AbstractSVNCommand) o1;
                    AbstractSVNCommand c2 = (AbstractSVNCommand) o2;
                    if (c1 instanceof SVNDumpFilterCommand && c2 instanceof SVNDumpFilterCommand) {
                        SVNDumpFilterCommand dumpFilterCommand1 = (SVNDumpFilterCommand) c1;
                        SVNDumpFilterCommand dumpFilterCommand2 = (SVNDumpFilterCommand) c2;
                        if (dumpFilterCommand1.getOutputPriority() != dumpFilterCommand2.getOutputPriority()) {
                            return dumpFilterCommand1.getOutputPriority() < dumpFilterCommand2.getOutputPriority() ? -1 : 1;                           
                        }
                    }
                    return c1.getName().compareTo(c2.getName());
                }
            };
           
            String help = SVNCommandUtil.getGenericHelp(getEnvironment().getProgramName(), GENERIC_HELP_HEADER,
                    null, commandComparator);
View Full Code Here


                        options.add(SVNDumpFilterOption.VERSION);
                        return options;
                    }
                   
                    public void run() throws SVNException {
                        AbstractSVNCommand helpCommand = AbstractSVNCommand.getCommand("help");
                        helpCommand.init(SVNDumpFilterCommandEnvironment.this);
                        helpCommand.run();
                    }
                };
                AbstractSVNCommand.registerCommand(versionCommand);
                return "--version";
            }
View Full Code Here

                        options.add(SVNSyncOption.VERSION);
                        return options;
                    }
                   
                    public void run() throws SVNException {
                        AbstractSVNCommand helpCommand = AbstractSVNCommand.getCommand("help");
                        helpCommand.init(SVNSyncCommandEnvironment.this);
                        helpCommand.run();
                    }
                };
                AbstractSVNCommand.registerCommand(versionCommand);
                return "--version";
            }
View Full Code Here

    public void run() throws SVNException {
        if (!getSVNSyncEnvironment().getArguments().isEmpty()) {
            for (Iterator commands = getSVNSyncEnvironment().getArguments().iterator(); commands.hasNext();) {
                String commandName = (String) commands.next();
                AbstractSVNCommand command = AbstractSVNCommand.getCommand(commandName);
                if (command == null) {
                    getSVNSyncEnvironment().getErr().println("\"" + commandName + "\": unknown command.\n");
                    continue;
                }
                String help = SVNCommandUtil.getCommandHelp(command, getEnvironment().getProgramName(), true);
                getSVNSyncEnvironment().getOut().println(help);
            }
        } else if (getSVNSyncEnvironment().isVersion()) {
            String version = SVNCommandUtil.getVersion(getEnvironment(), getSVNSyncEnvironment().isQuiet());
            getEnvironment().getOut().println(version);
            getEnvironment().getOut().println(VERSION_HELP_FOOTER);
        } else if (getSVNSyncEnvironment().getArguments().isEmpty()) {

            Comparator commandComparator = new Comparator() {
                public int compare(Object o1, Object o2) {
                    AbstractSVNCommand c1 = (AbstractSVNCommand) o1;
                    AbstractSVNCommand c2 = (AbstractSVNCommand) o2;
                    if (c1 instanceof SVNSyncCommand && c2 instanceof SVNSyncCommand) {
                        SVNSyncCommand syncCommand1 = (SVNSyncCommand) c1;
                        SVNSyncCommand syncCommand2 = (SVNSyncCommand) c2;
                        if (syncCommand1.getOutputPriority() != syncCommand2.getOutputPriority()) {
                            return syncCommand1.getOutputPriority() < syncCommand2.getOutputPriority() ? -1 : 1;
                        }
                    }
                    return c1.getName().compareTo(c2.getName());
                }
            };

            String help = SVNCommandUtil.getGenericHelp(getEnvironment().getProgramName(), GENERIC_HELP_HEADER,
                    null, commandComparator);
View Full Code Here

                        options.add(SVNLookOption.VERSION);
                        return options;
                    }
                   
                    public void run() throws SVNException {
                        AbstractSVNCommand helpCommand = AbstractSVNCommand.getCommand("help");
                        helpCommand.init(SVNLookCommandEnvironment.this);
                        helpCommand.run();
                    }
                };
                AbstractSVNCommand.registerCommand(versionCommand);
                return "--version";
            }
View Full Code Here

    public void run() throws SVNException {
        if (!getEnvironment().getArguments().isEmpty()) {
            for (Iterator commands = getEnvironment().getArguments().iterator(); commands.hasNext();) {
                String commandName = (String) commands.next();
                AbstractSVNCommand command = AbstractSVNCommand.getCommand(commandName);
                if (command == null) {
                    getEnvironment().getErr().println("\"" + commandName + "\": unknown command.\n");
                    continue;
                }
                getEnvironment().getProgramName();
View Full Code Here

                    options.add(SVNVersionOption.VERSION);
                    return options;
                }
               
                public void run() throws SVNException {
                    AbstractSVNCommand helpCommand = AbstractSVNCommand.getCommand("help");
                    helpCommand.init(SVNVersionCommandEnvironment.this);
                    helpCommand.run();
                }

                public String getName() {
                    return "--version";
                }
View Full Code Here

                        options.add(SVNOption.QUIET);
                        return options;
                    }
                   
                    public void run() throws SVNException {
                        AbstractSVNCommand helpCommand = AbstractSVNCommand.getCommand("help");
                        helpCommand.init(SVNCommandEnvironment.this);
                        helpCommand.run();
                    }
                };
                AbstractSVNCommand.registerCommand(versionCommand);
                return "--version";
            }
View Full Code Here

    public void run() throws SVNException {
        if (!getEnvironment().getArguments().isEmpty()) {
            for (Iterator commands = getEnvironment().getArguments().iterator(); commands.hasNext();) {
                String commandName = (String) commands.next();
                AbstractSVNCommand command = AbstractSVNCommand.getCommand(commandName);
                if (command == null) {
                    getEnvironment().getErr().println("\"" + commandName + "\": unknown command.\n");
                    continue;
                }
                String help = SVNCommandUtil.getCommandHelp(command, getEnvironment().getProgramName(), true);
View Full Code Here

                        options.add(SVNAdminOption.QUIET);
                        return options;
                    }
                   
                    public void run() throws SVNException {
                        AbstractSVNCommand helpCommand = AbstractSVNCommand.getCommand("help");
                        helpCommand.init(SVNAdminCommandEnvironment.this);
                        helpCommand.run();
                    }
                };
                AbstractSVNCommand.registerCommand(versionCommand);
                return "--version";
            }
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.cli.AbstractSVNCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.