Skip to content

Commit a5bc935

Browse files
committed
Say why blocks() is handed sizes it could reach for
Every field of HelpSizes is on the ParseResult too, so this reads like the parameter usageText() just lost. It is not one. A text width of zero means ask, sizes carries the answer rather than the zero, and the answer is settled once and handed to render() as well. An override working it out again would call console::width() a second time, and a terminal resized between the two halves would lay the usage line out to one width and the descriptions to another. The cpp said this beside the code that does it. The header, which is where somebody asks the question, did not.
1 parent 8031cb5 commit a5bc935

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

include/stdcorelib/support/commandline.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,6 +1562,11 @@ namespace stdc::cli {
15621562

15631563
/// What the help text is made of, in the order ParseResult::helpLayout() asks for and
15641564
/// with the groups a CommandCatalogue asks for already split.
1565+
///
1566+
/// \note \a sizes is not what \a result was given, and is not to be worked out again
1567+
/// from it. A text width of zero means ask, and this is the answer, settled once
1568+
/// and handed to render() as well, so that a terminal resized in between cannot
1569+
/// lay the usage line out to one width and the descriptions to another.
15651570
virtual std::vector<HelpBlock> blocks(const ParseResult &result,
15661571
const HelpSizes &sizes) const;
15671572

0 commit comments

Comments
 (0)