使用 symfony 为消息着色很方便:
$output->writeln('<info>Hello world</info>');
Run Code Online (Sandbox Code Playgroud)
在此配色方案中设置进度条的最简单方法是什么。没什么特别的 - 没有额外的:只是将进度条声明为标准颜色的信息:fg=green bg=black?就这样
我只找到了超级花哨的自定义说明 - 我不需要。
我的各种尝试使用
$progress->setFormat();
Run Code Online (Sandbox Code Playgroud)
或者
$progress->setFormatDefinition();
Run Code Online (Sandbox Code Playgroud)
不成功