Skip to content

Commit

Permalink
Fixes #162, #163: Only show --show-all-events and --parent-stack when…
Browse files Browse the repository at this point in the history
… appropriate. (#183)
  • Loading branch information
askreet committed Nov 26, 2016
1 parent 97eca02 commit 43f1384
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 19 deletions.
26 changes: 16 additions & 10 deletions docs/user-guide/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ Use this option to disable the animated logger. The logger is also
disabed automatically in environments where STDIN is not a tty, such
as Jenkins.

## `--[no-]show-all-events`

*Default: Disabled*

By default, Moonshot show only error CloudFormation events during the
`create`, `update`, and `delete` actions. With this enabled, all
events are displayed to the screen. This can be quite noisy, but also
helpful if you want to see where your stack updates are taking the
most time, for example.

## `--[no-]verbose / -v`

*Default: Disabled*
Expand Down Expand Up @@ -76,6 +66,16 @@ value of.

### Options

## `--[no-]show-all-events`

*Default: Disabled*

By default, Moonshot show only error CloudFormation events during the
`create`, `update`, and `delete` actions. With this enabled, all
events are displayed to the screen. This can be quite noisy, but also
helpful if you want to see where your stack updates are taking the
most time, for example.

#### `--parent=STACK_NAME / -p STACK_NAME`

*Default: `parents_stacks` configuration option in `Moonfile.rb`,
Expand Down Expand Up @@ -313,6 +313,12 @@ moonshot deploy 1.0.0

Delete an existing environment.

### Options

#### `--[no-]show-all-events`

See [create][#moonshot-create].

### Example

```shell
Expand Down
9 changes: 0 additions & 9 deletions lib/moonshot/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ def parser
o.on('--[no-]interactive-logger', TrueClass, 'Enable or disable fancy logging') do |v|
@use_interactive_logger = v
end

o.on('--[no-]show-all-events', FalseClass, 'Show all stack events during update') do |v|
Moonshot.config.show_all_stack_events = v
end

o.on('-pPARENT_STACK', '--parent=PARENT_STACK',
'Parent stack to import parameters from') do |v|
Moonshot.config.parent_stacks = [v]
end
end
end

Expand Down
2 changes: 2 additions & 0 deletions lib/moonshot/commands/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module Moonshot
module Commands
class Create < Moonshot::Command
include ParameterArguments
include ShowAllEventsOption
include ParentStackOption

self.usage = 'create [options]'
self.description = 'Create a new environment'
Expand Down
2 changes: 2 additions & 0 deletions lib/moonshot/commands/delete.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Moonshot
module Commands
class Delete < Moonshot::Command
include ShowAllEventsOption

self.usage = 'delete [options]'
self.description = 'Delete an existing environment'

Expand Down
14 changes: 14 additions & 0 deletions lib/moonshot/commands/parent_stack_option.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module Moonshot
module Commands
module ParentStackOption
def parser
parser = super

parser.on('-pPARENT_STACK', '--parent=PARENT_STACK',
'Parent stack to import parameters from') do |v|
Moonshot.config.parent_stacks = [v]
end
end
end
end
end
13 changes: 13 additions & 0 deletions lib/moonshot/commands/show_all_events_option.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Moonshot
module Commands
module ShowAllEventsOption
def parser
parser = super

parser.on('--[no-]show-all-events', TrueClass, 'Show all stack events during update') do |v|
Moonshot.config.show_all_stack_events = v
end
end
end
end
end
2 changes: 2 additions & 0 deletions lib/moonshot/commands/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module Moonshot
module Commands
class Update < Moonshot::Command
include ParameterArguments
include ShowAllEventsOption
include ParentStackOption

self.usage = 'update [options]'
self.description = 'Update the CloudFormation stack within an environment.'
Expand Down

0 comments on commit 43f1384

Please sign in to comment.