Skip to content
Snippets Groups Projects
Unverified Commit 8fca70e7 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

--cache: use CLI::Parser.

parent 0fff6e0c
No related branches found
No related tags found
No related merge requests found
#: * `--cache`:
#: Display Homebrew's download cache. See also `HOMEBREW_CACHE`.
#:
#: * `--cache` [`--build-from-source`|`-s`] [`--force-bottle`] <formula>:
#: Display the file or directory used to cache <formula>.
require "fetch"
require "cli_parser"
module Homebrew
module_function
def __cache_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`--cache` [<options>] [<formula>]
Display Homebrew's download cache. See also `HOMEBREW_CACHE`.
If <formula> is provided, display the file or directory used to cache <formula>.
EOS
switch "-s", "--build-from-source",
description: "Show the cache file used when building from source."
switch "--force-bottle",
description: "Show the cache file used when pouring a bottle."
conflicts "--build-from-source", "--force-bottle"
end
end
def __cache
__cache_args.parse
if ARGV.named.empty?
puts HOMEBREW_CACHE
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment