File tree Expand file tree Collapse file tree 3 files changed +49
-0
lines changed
Expand file tree Collapse file tree 3 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ var findRange = require('semver-greatest-satisfied-range');
1111var ansi = require ( './lib/shared/ansi' ) ;
1212var exit = require ( './lib/shared/exit' ) ;
1313var tildify = require ( './lib/shared/tildify' ) ;
14+ var makeTitle = require ( './lib/shared/make-title' ) ;
1415var cliOptions = require ( './lib/shared/cli-options' ) ;
1516var completion = require ( './lib/shared/completion' ) ;
1617var verifyDeps = require ( './lib/shared/verify-dependencies' ) ;
@@ -35,6 +36,7 @@ process.env.INIT_CWD = process.cwd();
3536
3637var cli = new Liftoff ( {
3738 name : 'gulp' ,
39+ processTitle : makeTitle ( 'gulp' , process . argv . slice ( 2 ) ) ,
3840 completions : completion ,
3941 extensions : interpret . jsVariants ,
4042 v8flags : v8flags ,
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ function makeTitle ( cmd , argv ) {
4+ if ( ! argv || argv . length === 0 ) {
5+ return cmd ;
6+ }
7+
8+ return [ cmd ] . concat ( argv ) . join ( ' ' ) ;
9+ }
10+
11+ module . exports = makeTitle ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ var expect = require ( 'expect' ) ;
4+
5+ var makeTitle = require ( '../../lib/shared/make-title' ) ;
6+
7+ describe ( 'lib: make-title' , function ( ) {
8+
9+ it ( 'returns the command if no argv passed' , function ( done ) {
10+ var title = makeTitle ( 'gulp' ) ;
11+
12+ expect ( title ) . toEqual ( 'gulp' ) ;
13+ done ( ) ;
14+ } ) ;
15+
16+ it ( 'returns the command if argv is 0 length' , function ( done ) {
17+ var title = makeTitle ( 'gulp' , [ ] ) ;
18+
19+ expect ( title ) . toEqual ( 'gulp' ) ;
20+ done ( ) ;
21+ } ) ;
22+
23+ it ( 'returns the command and argvs if not empty' , function ( done ) {
24+ var title = makeTitle ( 'gulp' , [ 'build' ] ) ;
25+
26+ expect ( title ) . toEqual ( 'gulp build' ) ;
27+ done ( ) ;
28+ } ) ;
29+
30+ it ( 'concats all argv' , function ( done ) {
31+ var title = makeTitle ( 'gulp' , [ 'build' , '--prod' ] ) ;
32+
33+ expect ( title ) . toEqual ( 'gulp build --prod' ) ;
34+ done ( ) ;
35+ } ) ;
36+ } ) ;
You can’t perform that action at this time.
0 commit comments