Omit confirmation interactivity with -y/--yes

This commit is contained in:
Juan Cruz Viotti 2014-11-21 10:44:48 -04:00
parent 0697510f38
commit fed63fd178
2 changed files with 7 additions and 1 deletions

View File

@ -41,10 +41,13 @@ exports.restart = authHooks.failIfNotLoggedIn (id) ->
server.post "/application/#{id}/restart", (error) ->
throw error if error?
exports.remove = authHooks.failIfNotLoggedIn (id) ->
exports.remove = authHooks.failIfNotLoggedIn (id, program) ->
async.waterfall [
(callback) ->
if program.parent.yes
return callback(null, true)
widgets.confirmRemoval('application', callback)
(confirmed, callback) ->

View File

@ -5,6 +5,9 @@ packageJSON = require('../package.json')
program = require('commander')
program.version(packageJSON.version)
# ---------- Options ----------
program.option('-y, --yes', 'Confirm non interactively')
# ---------- Auth Module ----------
auth = require('./actions/auth')