Core\Cli
Works with the terminal in a command-line program. It gives the program's arguments and the terminal's size and colours, asks the user questions, and shows output that updates in place.
Members
15 members.
| Member | Signature |
|---|---|
arguments | arguments(): array<tainted string> |
write | write(string|Core\Cli\Text $value, { stream?: Core\Cli::Stream, newline?: bool }): void |
escape | escape(string $text): string |
isTty | isTty(Core\Cli::Stream $stream): bool |
width | width(): uint |
height | height(): uint |
colorDepth | colorDepth(): Core\Cli::ColorDepth |
displayWidth | displayWidth(string $value): uint |
ask | ask(string $question, { default?: string, validate?: callable }): tainted string |
confirm | confirm(string $question, { default?: bool }): bool |
select | select(string $question, array<T> $choices, { labels?: callable, default?: T }): T |
selectMany | selectMany(string $question, array<T> $choices, { labels?: callable }): array<T> |
askSecret | askSecret(string $question): secret tainted string |
showLive | showLive(callable(Core\Cli\Live): T $body): T |
showProgress | showProgress(uint $total, callable(Core\Cli\Progress): T $body): T |
Enums
StreamOne of the three standard streams a process starts with. Whether output goes to a terminal is always checked for one stream, not for the whole process.ColorDepthHow much colour standard output can show. The cases are in increasing order, so you can compare two depths.
