Aligment in multiline description (#269)

This commit is contained in:
elszon
2019-04-28 16:22:36 +02:00
committed by Henry Schreiner
parent b1036a1ad0
commit ca4bc6a6fc
2 changed files with 18 additions and 1 deletions

View File

@@ -470,6 +470,18 @@ TEST(THelp, CustomHelp) {
}
}
TEST(THelp, NextLineShouldBeAlignmentInMultilineDescription) {
CLI::App app;
int i;
const std::string first{"first line"};
const std::string second{"second line"};
app.add_option("-i,--int", i, first + "\n" + second);
const std::string help = app.help();
const auto width = app.get_formatter()->get_column_width();
EXPECT_THAT(help, HasSubstr(first + "\n" + std::string(width, ' ') + second));
}
TEST(THelp, NiceName) {
CLI::App app;