跳转到主要内容

Given /^save (STDOUT|STDERR) ([\'].+[^\'])?\s?as \{(\w+)\}$/

Store STDOUT or STDERR contents in a variable.


Usage

Scenario: My example scenario
  When I run `wp package path`
  Then save STDOUT as {PACKAGE_PATH}

Scenario: My other scenario
  When I run `wp core download`
  Then save STDOUT 'Downloading WordPress ([\d\.]+)' as {VERSION}

Behat steps documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.



📖 来源:WP-CLI Handbook · 作者:WP-CLI 开发组与贡献者 · 许可:MIT · 同步自上游提交 e01cbb1(2026-10-06)· 改动:仅格式转换

本页由 cocobook 外部书同步自动生成,此处只读;要修改请到菲码书稿仓 CocoBook/external-books 的 overlay 目录提合并请求。