Skip to content

Commit

Permalink
fix(@angular/cli): Add an error message when we call ng doc without…
Browse files Browse the repository at this point in the history
… keyword. Currently, we open a page with the keyword `undefined`. (#13604)
  • Loading branch information
wKoza authored and vikerman committed Feb 7, 2019
1 parent 7137c27 commit e113c44
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/angular/cli/commands/doc-impl.ts
Expand Up @@ -14,6 +14,11 @@ const opn = require('opn');

export class DocCommand extends Command<DocCommandSchema> {
public async run(options: DocCommandSchema & Arguments) {
if (!options.keyword) {
this.logger.error('You should specify a keyword, for instance, `ng doc ActivatedRoute`.');

return 0;
}
let searchUrl = `https://angular.io/api?query=${options.keyword}`;
if (options.search) {
searchUrl = `https://www.google.com/search?q=site%3Aangular.io+${options.keyword}`;
Expand Down

0 comments on commit e113c44

Please sign in to comment.