From fed63fd1786685476bf86a5099f286be199e4933 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 21 Nov 2014 10:44:48 -0400 Subject: [PATCH] Omit confirmation interactivity with -y/--yes --- lib/actions/app.coffee | 5 ++++- lib/app.coffee | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/actions/app.coffee b/lib/actions/app.coffee index 5a288057..3c3ef6bc 100644 --- a/lib/actions/app.coffee +++ b/lib/actions/app.coffee @@ -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) -> diff --git a/lib/app.coffee b/lib/app.coffee index 7508093e..50c1d6e7 100644 --- a/lib/app.coffee +++ b/lib/app.coffee @@ -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')