d-examples/source/app.d

46 lines
2.1 KiB
D
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import examples;
import commandr;
import core.stdc.stdlib : EXIT_SUCCESS;
private string programName = "d-examples";
int main(string[] args)
{
auto argumets = new Program(programName, examplesVersion)
.add(new Command("common", "Общего назначения")
.add(new Command("isexists",
"Проверяет наличие исполняемого файла в директориях,указанных в переменной окружения PATH"))
.add(new Command("splittext",
"Форматирует массив строк, разбивая их на строки указанной длины"))
.add(new Command("variant", "Динамическая работа с разными типами данных в одной переменной"))
)
.add(new Command("ncurses", "Использование библиотеки ncurses")
.add(new Command("menu", "Интерактивное консольное меню"))
.add(new Command("password", "Консольное окно для ввода пароля"))
)
.add(new Command("shell", "Запуск команд в shell")
.add(new Command("pipe", "Чтение выходных данных на примере ip"))
.add(new Command("spinner", "Эмуляция статуса выполнения процесса"))
.add(new Command("ospinner",
"Демонстрирует объектно-ориентированный подход к созданию анимации спиннера в консоли"))
)
.parse(args);
argumets
.on("common", (common) { common
.on("variant", (variant) { fVariant(); })
.on("splittext", (splittext) { formatLines(); })
.on("isexists", (isexists) { isExists(); });
})
.on("ncurses", (ncurses) { ncurses
.on("menu", (items) { menuNcurses(); })
.on("password", (password) { passwordNcurses(); });
})
.on("shell", (shell) { shell
.on("pipe", (pipe) { pipeShell(); })
.on("spinner", (spinner) { spinnerShell(); })
.on("ospinner", (ospinner) { oSpinnerShell(); });
});
return EXIT_SUCCESS;
}