File tree Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Original file line number Diff line number Diff line change
1
+ /* jshint node: true */
2
+ 'use strict' ;
3
+
4
+ var Command = require ( 'ember-cli/lib/models/command' ) ;
5
+ var DocTask = require ( '../tasks/doc' ) ;
6
+
7
+ module . exports = Command . extend ( {
8
+ name : 'doc' ,
9
+ description : 'Opens the official Angular documentation for a given keyword.' ,
10
+ works : 'everywhere' ,
11
+ anonymousOptions : [
12
+ '<keyword>'
13
+ ] ,
14
+ run : function ( commandOptions , rawArgs ) {
15
+ var keyword = rawArgs [ 0 ] ;
16
+
17
+ var docTask = new DocTask ( {
18
+ ui : this . ui ,
19
+ analytics : this . analytics ,
20
+ project : this . project
21
+ } ) ;
22
+
23
+ return docTask . run ( keyword ) ;
24
+ }
25
+ } ) ;
Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ module.exports = {
13
13
'lint' : require ( './commands/lint' ) ,
14
14
'format' : require ( './commands/format' ) ,
15
15
'version' : require ( './commands/version' ) ,
16
- 'completion' : require ( './commands/completion' )
16
+ 'completion' : require ( './commands/completion' ) ,
17
+ 'doc' : require ( './commands/doc' )
17
18
} ;
18
19
}
19
20
} ;
Original file line number Diff line number Diff line change
1
+ /* jshint node: true */
2
+ 'use strict' ;
3
+
4
+ var Task = require ( 'ember-cli/lib/models/task' ) ;
5
+ var opn = require ( 'opn' ) ;
6
+
7
+ module . exports = Task . extend ( {
8
+ run : function ( keyword ) {
9
+ var searchUrl = 'https://angular.io/docs/ts/latest/api/#!?apiFilter=' + keyword ;
10
+ return opn ( searchUrl ) ;
11
+ }
12
+ } ) ;
Original file line number Diff line number Diff line change 43
43
"leek" : " 0.0.21" ,
44
44
"lodash" : " ^4.6.1" ,
45
45
"multidep" : " ^2.0.0" ,
46
+ "opn" : " 4.0.1" ,
46
47
"resolve" : " ^1.1.7" ,
47
48
"shelljs" : " ^0.6.0" ,
48
49
"silent-error" : " ^1.0.0" ,
You can’t perform that action at this time.
0 commit comments