Merge pull request #8312 from maxim-belkin/fix-cleanup

cleanup: fix input handling

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Maxim Belkin 2020-08-12 09:29:23 -05:00 committed by GitHub
commit e5e7a9a7e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,10 @@ module Homebrew
def cleanup
args = cleanup_args.parse
if args.prune.present? && !Integer(args.prune, exception: false) && args.prune != "all"
raise UsageError, "--prune= expects an integer or 'all'."
end
cleanup = Cleanup.new(*args.named, dry_run: args.dry_run?, scrub: args.s?, days: args.prune&.to_i)
if args.prune_prefix?
cleanup.prune_prefix_symlinks_and_directories