Skip to content

Commit 5d8ecb6

Browse files
committed
Add --dry-run option
#22
1 parent 1d294e6 commit 5d8ecb6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/bcu.rb

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ def self.parse(args)
1313
opts.on("-a", "--all", "Force upgrade outdated apps including the ones marked as latest") do
1414
options.all = true
1515
end
16+
17+
opts.on("--dry-run", "Print outdated apps without upgrading them") do
18+
options.dry_run = true
19+
end
1620
end
1721

1822
parser.parse!(args)
@@ -22,6 +26,8 @@ def self.parse(args)
2226
def self.process(args)
2327
options = parse(args)
2428
Hbc.outdated(options.all).each do |app|
29+
next if options.dry_run
30+
2531
puts "==> Upgrading #{app[:name]} to #{app[:latest]}"
2632

2733
# Clean up the cask metadata container.

0 commit comments

Comments
 (0)