CLI tools

CLI tools provide facilities for the command line interface development

Лицензия

Лицензия

Категории

Категории

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

Группа

ru.d-shap
Идентификатор

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

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

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

1.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

CLI tools
CLI tools provide facilities for the command line interface development
Ссылка на сайт

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

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

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

https://github.com/d-shap/cli

Скачать cli

Имя Файла Размер
cli-1.2.pom
cli-1.2.jar 77 KB
cli-1.2-sources.jar 63 KB
cli-1.2-javadoc.jar 197 KB
Обзор

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

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

Зависимости

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
ru.d-shap : assertions jar 2.0

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

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

CLI tools

CLI tools provide facilities for the command line interface development.

Command line interface can be defined as a command flow. The commands in this flow are executed step by step.

The command implementation class should extend the AbstractCommand class or it's subclasses. Each command performs some actions and then defines the next command based on this actions. This is the command flow.

The CommandRunner class is used to run the command flow. This class obtains the first command in the flow and executes all the commands in this flow.

Some commands require user interaction, some does not. For example, the application first collects the required data from the user and then performs some actions based on this data.

Commands, that require the user interaction, should extend the AbstractUserActionCommand class or it's subclasses. Some useful subclasses are AbstractMenuCommand to define the menu, AbstractInputCommand to obtain the data from the user like strings, numbers etc.

Commands, that does not require the user interaction, should extend the AbstractExecutionCommand class or it's subclasses.

All the commands in the flow share the same context. One command in the flow can put the value to the context, another command can use this value to perform some actions.

The command flow can contain nested flows. Nested flow has the nested context. All the commands of the nested flow share the same nested context, but nested flow does not affect the parent context.

The nested flow is defined by the class, that extends the AbstractContainerCommand.

Latest release

CLI tools:

  • <groupId>: ru.d-shap
  • <artifactId>: cli
  • <version>: 1.2

Donation

If you find my code useful, you can bye me a coffee

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

Версия
1.2
1.1
1.0