adamgaskins/gumwrapper
最新稳定版本:v0.1.2
Composer 安装命令:
composer require adamgaskins/gumwrapper
包简介
A php wrapper for Gum: a tool for glamorous shell scripts 🎀
README 文档
README
A lightweight wrapper around Gum: A tool for glamorous shell scripts. See the Gum documentation for more documentation on the underlying features.
Getting Started
Install with composer:
composer install adamgaskins/gumwrapper
Usage:
$gum = new Gum(); $gum->choose([ 'apple', 'banana', 'pear' ])
The following platforms are currently supported. Please make a PR to BinManager.php to add support for other platforms Gum supports!
- Apple M1
- Apple Intel
- Windows i386
- Windows x86_64
Reference
Choose
$result = $gum->choose([ 'apple', 'banana', 'pear', 'orange' ]); // example: "apple"
$gum->choose( $options = [ 'apple', 'banana', 'pear', 'orange' ], $limit = 2, // enable multiselect $height = 10 // scroll if more than 10 items );
Confirm
$result = $gum->confirm(); // example: true
$gum->confirm( $prompt = 'Are you sure?', $affirmativeText = 'Yeah!', $negativeText = 'Actually, no', $default = false // default to "no" option );
Input
$result = $gum->input('What is your name?'); // example: "Adam"
$gum->input( $placeholder = 'Password', $prompt = '> ', $initialValue = null, $charLimit = 400, $width = 10, $password = true );
Spin
Note: Do not write any output or call any other Gum commands before ->terminate()-ing the spinner, or errors may occur.
$spinner = $gum->spin(); sleep(10); // do some long task $spinner->terminate();
$gum->spin( $title = 'Downloading files...', $spinner = 'pulse' );
Todo:
- Write
- Filter
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-12