Skip to content

Commit

Permalink
fix(@angular/cli): multiline help descriptions are not aligned
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-agius4 authored and kyliau committed Oct 23, 2018
1 parent c513511 commit 0fe6e1e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/angular/cli/models/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,15 @@ export abstract class Command<T extends BaseCommandOptions = BaseCommandOptions>
const args = options.filter(opt => opt.positional !== undefined);
const opts = options.filter(opt => opt.positional === undefined);

const formatDescription = (description: string) =>
` ${description.replace(/\n/g, '\n ')}`;

if (args.length > 0) {
this.logger.info(`arguments:`);
args.forEach(o => {
this.logger.info(` ${terminal.cyan(o.name)}`);
if (o.description) {
this.logger.info(` ${o.description}`);
this.logger.info(formatDescription(o.description));
}
});
}
Expand All @@ -108,7 +111,7 @@ export abstract class Command<T extends BaseCommandOptions = BaseCommandOptions>
: '';
this.logger.info(` ${terminal.cyan('--' + strings.dasherize(o.name))} ${aliases}`);
if (o.description) {
this.logger.info(` ${o.description}`);
this.logger.info(formatDescription(o.description));

This comment has been minimized.

Copy link
@timtim9620

timtim9620 Oct 27, 2018

npm install -g @angular/cli

}
});
}
Expand Down

0 comments on commit 0fe6e1e

Please sign in to comment.