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');
11
11
var ansi = require ( './lib/shared/ansi' ) ;
12
12
var exit = require ( './lib/shared/exit' ) ;
13
13
var tildify = require ( './lib/shared/tildify' ) ;
14
+ var makeTitle = require ( './lib/shared/make-title' ) ;
14
15
var cliOptions = require ( './lib/shared/cli-options' ) ;
15
16
var completion = require ( './lib/shared/completion' ) ;
16
17
var verifyDeps = require ( './lib/shared/verify-dependencies' ) ;
@@ -35,6 +36,7 @@ process.env.INIT_CWD = process.cwd();
35
36
36
37
var cli = new Liftoff ( {
37
38
name : 'gulp' ,
39
+ processTitle : makeTitle ( 'gulp' , process . argv . slice ( 2 ) ) ,
38
40
completions : completion ,
39
41
extensions : interpret . jsVariants ,
40
42
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