Package ceylon.modules.spi

Examples of ceylon.modules.spi.Argument


     * @param values list of arguments
     * @param i      index of the argument name
     * @return the index of the last argument required eaten by this argument
     */
    public int setArgument(String name, ArgumentType type, String[] values, int i) {
        Argument argument = Argument.forArgumentName(name, type);
        if (argument == null)
            throw new CeylonRuntimeException("Unknown argument: " + name);

        if (i + argument.getRequiredValues() >= values.length)
            throw new CeylonRuntimeException("Missing argument value: " + name);

        int arg = i + 1;
        switch (argument) {
            case EXECUTABLE:
                executable = values[arg];
                break;
            case CACHE_CONTENT:
                cacheContent = true;
                break;
            case IMPLEMENTATION:
                impl.put(values[arg], values[arg + 1]);
                break;
            case SOURCE:
                src = values[arg];
                break;
            case RUN:
                run = values[arg];
                break;
            case CWD:
                cwd = values[arg];
                break;
            case SYSTEM_REPOSITORY:
                systemRepository = values[arg];
                break;
            case CACHE_REPOSITORY:
                cacheRepository = values[arg];
                break;
            case MAVEN_OVERRIDES:
                mavenOverrides = values[arg];
                break;
            case NO_DEFAULT_REPOSITORIES:
                noDefaultRepositories = true;
                break;
            case REPOSITORY:
                repositories.add(values[arg]);
                break;
            case VERBOSE:
                verbose = values[arg];
                break;
            case OFFLINE:
                offline = true;
                break;
            case HELP:
                printUsage(0);
                break;
            case VERSION:
                printVersion();
                break;
        }

        return i + argument.getRequiredValues();
    }
View Full Code Here

TOP

Related Classes of ceylon.modules.spi.Argument

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.