Make use of yargs.showHelp() instead of yargs.help(), as the latter uses

stderr by default
This commit is contained in:
Juan Cruz Viotti 2014-11-20 12:11:01 -04:00
parent d6c8d77ceb
commit ee0fc8206f
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ commandApplies = (command, args) ->
run = ->
if not @command._matchedCommand?
return console.log(@help())
return @showHelp()
signature = splitSignature(@command._matchedCommand.signature)
parameters = _.difference(@argv._, signature)
@command._matchedCommand.action.apply(this, parameters)

View File

@ -110,6 +110,6 @@ describe 'Yargs Command:', ->
expect(callback).to.have.been.calledWith(_.last(ARGS.appList._))
it 'should print help if no matches', ->
helpSpy = sinon.spy(yargs, 'help')
helpSpy = sinon.spy(yargs, 'showHelp')
yargs.command.run()
expect(helpSpy).to.have.been.called