Commander

Simple command line option parser and GIT-alike command manager for JDK7+.

Лицензия

Лицензия

Группа

Группа

com.rfksystems
Идентификатор

Идентификатор

commander
Последняя версия

Последняя версия

1.0.5
Дата

Дата

Тип

Тип

jar
Описание

Описание

Commander
Simple command line option parser and GIT-alike command manager for JDK7+.
Ссылка на сайт

Ссылка на сайт

https://github.com/rfksystems/commander
Организация-разработчик

Организация-разработчик

RFK Systems
Система контроля версий

Система контроля версий

http://github.com/rfksystems/commander/tree/master

Скачать commander

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.rfksystems/commander/ -->
<dependency>
    <groupId>com.rfksystems</groupId>
    <artifactId>commander</artifactId>
    <version>1.0.5</version>
</dependency>
// https://jarcasting.com/artifacts/com.rfksystems/commander/
implementation 'com.rfksystems:commander:1.0.5'
// https://jarcasting.com/artifacts/com.rfksystems/commander/
implementation ("com.rfksystems:commander:1.0.5")
'com.rfksystems:commander:jar:1.0.5'
<dependency org="com.rfksystems" name="commander" rev="1.0.5">
  <artifact name="commander" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.rfksystems', module='commander', version='1.0.5')
)
libraryDependencies += "com.rfksystems" % "commander" % "1.0.5"
[com.rfksystems/commander "1.0.5"]

Зависимости

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.mockito : mockito-all jar 1.10.19

Модули Проекта

Данный проект не имеет модулей.

Commander

Simple command line option parser and GIT-alike command manager for JDK7+.

Maven Central Build Status

Example usage

import com.rfksystems.commander.Command;
import com.rfksystems.commander.Commander;
import com.rfksystems.commander.Input;
import com.rfksystems.commander.exception.*;

import java.io.PrintStream;

public class Main {
    public static void main(final String[] args) {
        final Commander commander = new Commander();
        commander.addCommand(new Command() {
            public String getName() {
                return "hello";
            }

            public String getUsage() {
                return "[--world]";
            }

            public String getDescription() {
                return "Some command that says hello";
            }

            public int execute(Input input, PrintStream output) throws RuntimeArgumentException {
                final String outputString = "Hello";
                if (input.arguments.containsKey("world")) {
                    outputString = outputString.concat(" world!");
                }
                output.println(outputString);
                return 0;
            }
        });
        try {
            commander.execute(args, System.out);
        } catch (final NoCommandGivenException | CommandUnknownException | RuntimeArgumentException | InputParseException e) {
            e.printStackTrace();
        }
    }
}

Installation

Maven

Available in Maven Central since 1.0.5

<dependency>
    <groupId>com.rfksystems</groupId>
    <artifactId>commander</artifactId>
    <version>${commander.version}</version>
</dependency>

License

Apache License, Version 2.0

com.rfksystems

RFK Systems

Версии библиотеки

Версия
1.0.5