From 7c80a9006d2aaab53a47d3a34bd03052480aac03 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 4 Jun 2020 09:41:00 -0700 Subject: [PATCH] Add a "%?" ("hint") conversion to "tsprintf()" Summary: Ref T13546. Future "arc land" workflows use this element to provide "hint" or "next step" suggestions to make error resolution easier. Test Plan: Ran future "arc land" workflows, saw tips like "use --revision to do such-and-such" or "add these files to .gitignore". Maniphest Tasks: T13546 Differential Revision: https://secure.phabricator.com/D21309 --- src/xsprintf/tsprintf.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/xsprintf/tsprintf.php b/src/xsprintf/tsprintf.php index aea1e7f4..7b8e8934 100644 --- a/src/xsprintf/tsprintf.php +++ b/src/xsprintf/tsprintf.php @@ -48,6 +48,11 @@ function xsprintf_terminal($userdata, &$pattern, &$pos, &$value, &$length) { $value = PhutilTerminalString::escapeStringValue($value, false); $type = 's'; break; + case '?': + $value = tsprintf('** ? ** %s', $value); + $value = PhutilTerminalString::escapeStringValue($value, false); + $type = 's'; + break; case 'd': $type = 'd'; break;