Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/fog-prune/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ class Options
:boolean => true,
:default => false,
:description => 'Print action and exit'
)
option(:skip_confirmation,
:short => '-y',
:long => '--skip-confirmation',
:boolean => true,
:default => false,
:description => 'Prune nodes without prompting for confirmation'
)
option(:stale_nodes,
:short => '-S',
Expand Down
2 changes: 1 addition & 1 deletion lib/fog-prune/prune.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def prune!
ui.warn "Nodes to prune: #{nodes_to_prune.size}"
debug "#{nodes_to_prune.map(&:name).sort.join(', ')}"
unless(Config[:print_only])
ui.confirm('Destroy these nodes')
ui.confirm('Destroy these nodes') unless Config[:skip_confirmation]
nodes_to_prune.each do |node|
prune_node(node)
end
Expand Down