Skip to content

Commit 0dc4c40

Browse files
alan-agius4Keen Yee Liau
authored and
Keen Yee Liau
committed
fix(@angular/cli): multiline help descriptions are not aligned
1 parent a6f80e4 commit 0dc4c40

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/angular/cli/models/command.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,15 @@ export abstract class Command<T extends BaseCommandOptions = BaseCommandOptions>
8585
const args = options.filter(opt => opt.positional !== undefined);
8686
const opts = options.filter(opt => opt.positional === undefined);
8787

88+
const formatDescription = (description: string) =>
89+
` ${description.replace(/\n/g, '\n ')}`;
90+
8891
if (args.length > 0) {
8992
this.logger.info(`arguments:`);
9093
args.forEach(o => {
9194
this.logger.info(` ${terminal.cyan(o.name)}`);
9295
if (o.description) {
93-
this.logger.info(` ${o.description}`);
96+
this.logger.info(formatDescription(o.description));
9497
}
9598
});
9699
}
@@ -108,7 +111,7 @@ export abstract class Command<T extends BaseCommandOptions = BaseCommandOptions>
108111
: '';
109112
this.logger.info(` ${terminal.cyan('--' + strings.dasherize(o.name))} ${aliases}`);
110113
if (o.description) {
111-
this.logger.info(` ${o.description}`);
114+
this.logger.info(formatDescription(o.description));
112115
}
113116
});
114117
}

0 commit comments

Comments
 (0)