mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 02:54:21 +08:00
fix(@angular/cli): Add an error message when we call ng doc
without keyword. Currently, we open a page with the keyword undefined
. (#13604)
This commit is contained in:
parent
be79d2a662
commit
416b05061f
@ -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}`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user