cmd/cleanup.rb: fix input handling
This commit is contained in:
parent
3eba477b7c
commit
ac6295491c
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user