Skip to content

Commit c135550

Browse files
committed
btrfs-progs: help: indent option description newlines
A newline character in option description text will break line and then indent the text properly, can be used for lists or paragraphs. Signed-off-by: David Sterba <[email protected]>
1 parent 3d17609 commit c135550

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

common/help.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,13 @@ static void format_text(const char *line, FILE *outf)
156156
while (*line && *line == ' ')
157157
line++;
158158
while (*line && *line != ' ') {
159+
if (*line == '\n')
160+
break;
159161
fputc(*line, outf);
160162
line++;
161163
i++;
162164
}
163-
if (i > HELPINFO_DESC_WIDTH) {
165+
if (i > HELPINFO_DESC_WIDTH || (*line == '\n')) {
164166
if (*line) {
165167
fputc('\n', outf);
166168
line++;

0 commit comments

Comments
 (0)