From 644b11b071040a63aaf9c909c6f5b077880901e9 Mon Sep 17 00:00:00 2001 From: Massimiliano Marcon Date: Wed, 7 Aug 2013 11:17:33 -0400 Subject: [PATCH 1/2] --no-restart option for af env-add and af env-del --- lib/cli/commands/apps.rb | 5 +++-- lib/cli/runner.rb | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/cli/commands/apps.rb b/lib/cli/commands/apps.rb index 581aa3a..308c028 100644 --- a/lib/cli/commands/apps.rb +++ b/lib/cli/commands/apps.rb @@ -429,6 +429,7 @@ def environment(appname) end def environment_add(appname, k, v=nil) + no_restart = @options[:norestart] app = client.app_info(appname) env = app[:env] || [] k,v = k.split('=', 2) unless v @@ -437,7 +438,7 @@ def environment_add(appname, k, v=nil) app[:env] = env client.update_app(appname, app) display 'OK'.green - restart appname if app[:state] == 'STARTED' + restart appname if app[:state] == 'STARTED' unless no_restart end def environment_del(appname, variable) @@ -457,7 +458,7 @@ def environment_del(appname, variable) app[:env] = env client.update_app(appname, app) display 'OK'.green - restart appname if app[:state] == 'STARTED' + restart appname if app[:state] == 'STARTED' unless no_restart else display 'OK'.green end diff --git a/lib/cli/runner.rb b/lib/cli/runner.rb index 0c50e42..2257801 100644 --- a/lib/cli/runner.rb +++ b/lib/cli/runner.rb @@ -42,6 +42,8 @@ def parse_options! opts.on('--path PATH') { |path| @options[:path] = path } opts.on('--no-start') { @options[:nostart] = true } opts.on('--nostart') { @options[:nostart] = true } + opts.on('--no-restart') { @options[:norestart] = true } + opts.on('--norestart') { @options[:norestart] = true } opts.on('--force') { @options[:force] = true } opts.on('--all') { @options[:all] = true } From c7641a9f7768e5adf018c10d89e4343a4323e4df Mon Sep 17 00:00:00 2001 From: Massimiliano Marcon Date: Wed, 7 Aug 2013 17:23:06 +0200 Subject: [PATCH 2/2] Update README.md --no-restart docs --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9989e14..5cdf99c 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,10 @@ MIT license, please see the LICENSE file. All rights reserved._ Application Environment env List application environment variables - env-add Add an environment variable to an application - env-del Delete an environment variable to an application + env-add + [--no-restart] Add an environment variable to an application + env-del + [--no-restart] Delete an environment variable to an application Services services Lists of services available and provisioned