Skip to content

Commit 416b050

Browse files
wKozavikerman
authored andcommitted
fix(@angular/cli): Add an error message when we call ng doc without keyword. Currently, we open a page with the keyword undefined. (#13604)
1 parent be79d2a commit 416b050

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/angular/cli/commands/doc-impl.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ const opn = require('opn');
1414

1515
export class DocCommand extends Command<DocCommandSchema> {
1616
public async run(options: DocCommandSchema & Arguments) {
17+
if (!options.keyword) {
18+
this.logger.error('You should specify a keyword, for instance, `ng doc ActivatedRoute`.');
19+
20+
return 0;
21+
}
1722
let searchUrl = `https://angular.io/api?query=${options.keyword}`;
1823
if (options.search) {
1924
searchUrl = `https://www.google.com/search?q=site%3Aangular.io+${options.keyword}`;

0 commit comments

Comments
 (0)