CLI-Parsec - a declarative CLI-Parser-Framework

CLI-Parsec is a declarative CLI-Parser-Framework for Java. It is based on annotations and aims to ease defining and parsing command line interfaces.

Лицензия

Лицензия

Категории

Категории

CLI Взаимодействие с пользователем
Группа

Группа

de.dr1fter
Идентификатор

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

de.dr1fter.cli-parsec
Последняя версия

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

0.2.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

CLI-Parsec - a declarative CLI-Parser-Framework
CLI-Parsec is a declarative CLI-Parser-Framework for Java. It is based on annotations and aims to ease defining and parsing command line interfaces.
Ссылка на сайт

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

https://github.com/dr1fter/
Система контроля версий

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

https://github.com/dr1fter/cli-parsec

Скачать de.dr1fter.cli-parsec

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

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

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
com.google.guava : guava jar 15.0

test (3)

Идентификатор библиотеки Тип Версия
org.hamcrest : hamcrest-core jar 1.3
org.hamcrest : hamcrest-library jar 1.3
junit : junit jar 4.11

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

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

CLI-Parsec - a declarative CLI parser framework for Java

WHAT IS IT?

CLI-Parsec is a Java library that aims to ease the task of implementing command line interfaces. It uses a declarative approach based on Java annotations. The supported command line style adheres to the recommendations of POSIX (with some GNU extensions, such as long options). CLI-Parsec was inspired by both the Java 'jCommander'and the C# 'Command Line Parser Library'.

WHY USE IT?

The topmost design goal of CLI-Parsec is ease-of-use in combination with a consequent declaration-only approach. It will help you implement command line interfaces with a minimum amount of coding (as simple as creating a POJO and annotating its fields). CLI-Parsec is especially targeted towards complex command line interfaces (arbitrarily nested sub-commands with individual options).

HOW TO USE IT?

After its release to maven central, use the following dependency to reference the library:

<dependency>
  <groupId>de.dr1fter</groupId>
  <artifactId>de.dr1fter.cli-parsec</artifactId>
  <version>0.2.1</version>
</dependency>

Declare a type and annotate its fields in order to define the command line interface:

class MyOptions
{
  @Option(shortOption="x")
  boolean optionx;

  @Option
  String username;
}

Parse command line arguments:

MyOptions opts = new MyOptions();
CliParser.create().parse(opts, "-x", "--username", "myName");
//the fields of 'opts' are now initialised according to the command line args

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

Версия
0.2.1
0.2
0.1-MS7
0.1-MS6
0.1-MS5
0.1-MS4
0.1-MS3
0.1-MS2
0.1-MS1