47 Commits

Author SHA1 Message Date
Markus Reiter
5be4c9b5e0 Upgrade typed sigils. 2020-11-25 17:04:19 +01:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
d4c2ffd705 Refactor CLI::Parser. 2020-07-31 15:07:17 +02:00
Mike McQuaid
a7fe0ed847
cmd: use more and cleanup new args APIs. 2020-03-05 09:40:15 +00:00
EricFromCanada
2f7c3afeb8 cmd: improve wording of messages, spacing 2019-12-15 00:04:45 -05:00
EricFromCanada
b4303cd983 manpages: fix command & option descriptions 2019-08-20 09:03:33 -04:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
e40b171127
Rename cli_parser to cli/parser. 2019-04-17 22:16:50 +09:00
Mike McQuaid
6cb7a00f2d
cmd: remove --help headers and tweak docs. 2019-01-30 21:39:28 +00:00
Gautham Goli
e70df22acd
untap: Use CLI::Parser to parse args 2018-11-11 18:35:55 +05:30
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Markus Reiter
0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Max Nordlund
fa1fd70a37 Add all the top level comments 2016-04-10 22:59:25 +02:00
Xu Cheng
fa9a9ff5be tap-(un)pin/untap: better error message
Closes Homebrew/homebrew#49904.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-04-02 21:51:36 +08:00
Xu Cheng
1e487edd21 tap various commands: use tap name method.
Instead of hard coded `Homebrew/homebrew`
2016-03-07 19:43:46 +08:00
Xu Cheng
28f3dae8cd rename CoreFormulaRepository to CoreTap
Core tap will be separated from core code in the near future.
It makes sense to rename it to CoreTap.
2016-03-07 19:43:46 +08:00
Xu Cheng
2c25303949 remove unnecessary tap_args
It's now handled by Tap.fetch
2015-12-09 16:56:59 +08:00
Xu Cheng
e97610b916 add Tap#install and Tap#uninstall 2015-11-09 15:34:20 +08:00
Xu Cheng
3b520cf195 cache taps
There are plenty of IO operations inside Tap object, and it will be more
when implementing formula alias reverse look up(e.g. list all of alias
names for a formula). So let's cache them.

Some benchmark:

$ time brew info $(brew ruby -e 'puts Formula.tap_names') > /dev/null
Before: 6.40s user 2.42s system 96% cpu 9.134 total
After: 4.75s user 0.77s system 97% cpu 5.637 total

Closes Homebrew/homebrew#44377.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-30 16:25:30 +08:00
Dan Martinez
8374374168 Improve description searching and add a cache.
Closes Homebrew/homebrew#42281.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-09-08 15:23:37 +01:00
CNA-Bld
1a82b2133e implement pinning of taps 2015-08-10 12:17:25 +01:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Xu Cheng
b88cb13718 add TapUnavailableError 2015-06-14 21:28:36 +08:00
Xu Cheng
44383fecb8 (un)tap/update/readall: use Tap class 2015-06-11 15:28:29 +08:00
Peter Aronoff
965e2f50c3 brew tap: allow tapping non-GitHub repositories.
`brew tap` restricts users to GitHub and checks for private repos. I
created `brew any-tap` to support a wider variety of taps.

With very small changes (and no extra flags!), this change allows users
to use `brew tap` with GitHub as they always have or add one extra
argument and tap any repository of any type from anywhere.

    brew tap user/name              # Same as it ever was
    brew tap user/name URL          # Tap URL, whatever it happens to be

Closes Homebrew/homebrew#40326.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-06-05 21:54:12 +01:00
Xu Cheng
171c3dd2d9 tap/untap/update/prune: remove obsolete method, add migrate_taps 2015-05-27 13:53:40 +08:00
Mike McQuaid
6b41f38b69 untap: better match uninstall format. 2015-04-09 09:00:08 +01:00
chdiza
5e854164a7 untap: Handle multiple arguments
Closes Homebrew/homebrew#36436.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-02-01 20:12:13 +01:00
Jack Nagel
10a1952d2c Only "extend self" once on the Homebrew module 2014-06-19 13:10:36 -05:00
Adam Vandenberg
8d44db6b40 pluralize formulae in tap/untap
Closes Homebrew/homebrew#28560.
2014-05-26 18:33:31 -07:00
Jack Nagel
bdee729a41 Yield absolute paths from find_formula 2014-04-25 18:58:16 -05:00
Jack Nagel
b40a3413e3 Pass around only absolute paths when dealing with taps 2014-04-25 18:36:31 -05:00
Jack Nagel
a699eeb468 Don't use a regexp to match paths, just compare them for equality 2014-04-24 20:45:36 -05:00
Tsukasa OMOTO
54004a4759 Make the on-disk representation of taps unambiguous
This commit supports "-" and "_" in names of user and repository.

Closes Homebrew/homebrew#28203.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-04-24 17:10:41 -05:00
Misty De Meo
22f2f6aed3 tap/untap: use Array#length, not #count
Array#count was apparently introduced in 1.8.7.
2013-04-02 16:28:46 -05:00
Misty De Meo
e714a47c10 tap: adjust formula count for unsymlinked files
Relying on the output of `tapped` results in ignoring formulae which
already exist in core, with messages like "Tapped 0 formula" for
non-empty taps.
2013-03-04 12:12:47 -06:00
Peter Aronoff
00ef4b7fcb A more helpful error message for brew untap
`brew untap` without arguments currently errors out (as it should), but the
error message is generic and unhelpful. (The error message is borrowed from
a method in the tap command - `tap_args`.)

Closes Homebrew/homebrew#18186.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-03-02 12:11:56 +00:00
Max Howell
bb8d92c3cf Check tapped before trying to untap
If the tap-formula wasn't symlinked for some reason, don't throw an exception—the job is already done.
2012-03-23 00:16:08 +00:00
Max Howell
ceeb768c84 Special case Homebrew organization taps
We allow homebrew/dupes for instance, rather than Homebrew/dupes. Because nobody likes shifting in the terminal.

In the process of doing this I discovered some case-insensitive filesystem bugs we have avoided before because I had the foresight to mandate lowercase in formula names. GitHub considers Homebrew and homebrew to be different (even though you can't create both). So we had to allow case insensitivity in tap input. I have made it now so the resulting directory however is lowercased, neatly avoiding the issue. And so we also downcase tap arguments when applying them to tap directories or formula.
2012-03-18 01:45:26 +00:00
Max Howell
d388c43863 Generalise the untap step so we can add to update
brew-update needs to be able to unsymlink removed stuff from taps too.
2012-03-18 01:14:00 +00:00
Max Howell
919f36717c Don't break if symlink already exists during tap
This shouldn't happen but is possible and we should handle it.

Also added some puts when tapping/untapping.
2012-03-16 21:06:18 +00:00
Max Howell
0f02354073 HOMEBREW_LIBRARY
I got fed up writing HOMEBREW_REPOSITORY/"Library" and also correcting mistakes when I did HOMEBREW_PREFIX instead.
2012-03-16 21:06:18 +00:00
Max Howell
e6cb8cbee9 Pathname.atomic_write 2012-03-16 21:06:17 +00:00
Max Howell
903b1167a6 Prevent tapped symlinks showing up in git status
The symlinks taps write to Formula show up in git status, but this trick prevents this. brew-(un)tap maintain a .gitignore in Formula that contains all the symlinks brew-tap creates.

We add the .gitignore to the root .gitignore and TADA! Magic.
2012-03-16 21:06:15 +00:00
Max Howell
0c7e7ae437 brew tap and brew untap 2012-03-16 21:06:15 +00:00