| 
									
										
										
										
											2016-03-18 11:12:50 +01:00
										 |  |  | 'use strict'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Module dependencies | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Public node modules.
 | 
					
						
							|  |  |  | const _ = require('lodash'); | 
					
						
							|  |  |  | const program = require('commander'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Monkey-patch commander | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Allow us to display `help()`, but omit the wildcard (`*`) command.
 | 
					
						
							| 
									
										
										
										
											2016-07-11 13:03:35 +02:00
										 |  |  | program.Command.prototype.usageMinusWildcard = program.usageMinusWildcard = () => { | 
					
						
							| 
									
										
										
										
											2016-03-18 11:12:50 +01:00
										 |  |  |   program.commands = _.reject(program.commands, { | 
					
						
							|  |  |  |     _name: '*' | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  |   program.help(); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Force commander to display version information.
 | 
					
						
							| 
									
										
										
										
											2016-07-11 13:03:35 +02:00
										 |  |  | program.Command.prototype.versionInformation = program.versionInformation = () => { | 
					
						
							| 
									
										
										
										
											2016-03-18 11:12:50 +01:00
										 |  |  |   program.emit('version'); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | module.exports = program; |