@@ -5,17 +5,20 @@ var program = require('commander');
55var chalk = require ( 'chalk' ) ;
66var build_1 = require ( './src/build/build' ) ;
77var create_1 = require ( './src/create/create' ) ;
8+ var search_1 = require ( './src/search/search' ) ;
9+ var tutorials_1 = require ( './src/tutorials/tutorials' ) ;
10+ var publish_1 = require ( './src/publish/publish' ) ;
811program
912 . version ( '0.0.1' )
1013 . usage ( '[options] <keywords>' )
1114 . option ( '-b, --build [tutorial.md]' , 'tutorial markdown file' , / ^ .+ \. m d $ / i)
1215 . option ( '-c, --create [name]' , 'tutorial name' )
13- . option ( '-p, --publish' , 'publish tutorial to npm' )
14- . option ( '-l , --list ' , 'list of tutorial packages' )
16+ . option ( '-p, --publish [version] ' , 'publish tutorial to npm with new version number ' )
17+ . option ( '-t , --tutorials ' , 'list of tutorial packages' )
1518 . option ( '-s, --search [query]' , 'search for tutorial package' )
1619 . option ( '-r, --run' , 'run tutorial' )
1720 . parse ( process . argv ) ;
18- if ( ! program . args . length ) {
21+ if ( ! program . args . length && ! program . tutorials ) {
1922 program . help ( ) ;
2023} else {
2124 if ( program . build ) {
@@ -28,5 +31,16 @@ if (!program.args.length) {
2831 var packageName = program . args [ 0 ] ;
2932 create_1 . default ( packageName ) ;
3033 }
34+ if ( program . search ) {
35+ var query = program . args [ 0 ] ;
36+ search_1 . default ( query ) ;
37+ }
38+ if ( program . tutorials ) {
39+ tutorials_1 . default ( ) ;
40+ }
41+ if ( program . publish ) {
42+ var version = program . args [ 0 ] ;
43+ publish_1 . default ( version ) ;
44+ }
3145 process . exit ( 0 ) ;
3246}
0 commit comments