98 Commits

Author SHA1 Message Date
William Ma
fa7bd3bff6 args: Migrate usage of args loading methods to args.named 2020-08-23 09:02:20 -04:00
Markus Reiter
b48bc316e0 Use CLI::Parser for cask commands. 2020-08-13 05:15:15 +02:00
Markus Reiter
8a32954940 Move cask/all to just cask. 2020-08-09 01:34:07 +02:00
William Ma
907d4d7f74 Add shared methods for uninstalling, reinstalling casks 2020-08-05 11:04:40 -04:00
Markus Reiter
d4c2ffd705 Refactor CLI::Parser. 2020-07-31 15:07:17 +02:00
Markus Reiter
e14506e589 Pass args in uninstall instead of using global args. 2020-07-30 03:21:12 +02:00
Markus Reiter
c0d42dd922 Remove --force from global_options. 2020-07-28 10:31:11 +02:00
William Ma
525d1ac27d Fix PR issues 2020-07-03 10:33:38 -04:00
William Ma
1826be81f2 style: Replace Hash.new with {} 2020-07-02 15:29:58 -04:00
William Ma
eb1ea006f2 uninstall: Refactor when using --force 2020-07-02 15:28:41 -04:00
William Ma
72dcbd6fda style: Dedent cask uninstall block 2020-06-30 13:43:45 -04:00
William Ma
dff61c9eab style: Fix style issues 2020-06-30 12:21:21 -04:00
William Ma
8a05b5258a args: Refactor to load casks directly 2020-06-30 12:08:03 -04:00
William Ma
e733fa16a2 uninstall: Refactor to use AbstractCommand instead of declaring a class method 2020-06-24 15:08:42 -04:00
William Ma
90c26dadc7 uninstall: Add ability to reference casks from brew uninstall 2020-06-24 11:59:55 -04:00
skim
bb27478de0
fixes uninstall if formula is unavailable 2020-05-13 17:56:36 -07:00
Mike McQuaid
a3474e8361
uninstall: tweak paths array logic. 2020-05-10 19:22:54 +01:00
Mike Fiedler
e4823ea6fe
cmd/uninstall: fix Array comparison
In #7526 a comparison for `paths` was introduced, but if `paths` is ever
`nil`, this triggers an error.

Coercing the variable to an Array should alleviate this problem, as
`nil.to_a` produces an empty and comparable Array.

Fixes #7540

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
2020-05-10 11:28:42 -04:00
Mike McQuaid
04ae589d5c
cmd/uninstall: note etc files that stay around.
We don't remove `etc` files on uninstall. Now we have `pkgetc`, though,
we have a pretty decent guess at what files in `etc` may belong to a
given package and can warn about them being left around on uninstall.

Thoughts: should we do the same thing for `var`? I don't see it being
used nearly as consistently.
2020-05-08 10:37:51 +01:00
Mike McQuaid
3381cbf5c7
Use Homebrew::EnvConfig. 2020-04-07 09:58:26 +01:00
Mike McQuaid
40432d86f9
cmd/uninstall: handle unparsed arguments.
If `Homebrew.args` hasn't yet been populated then `named` will return
`nil`. Instead, ensure it is an array before we try to `join` it.

This is pretty much only a test-time problem but has been causing flaky
builds.
2020-03-11 11:21:28 +00: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
Zach Auten
fd429d0d75 Moved kegs from ARGV to args.rb 2019-11-09 11:56:47 -05:00
EricFromCanada
6520785307 manpages: grammar fixes 2019-08-20 08:26:26 -04:00
Mike McQuaid
c4f72312ce
Fixup brew style failures. 2019-04-30 09:19:18 +01: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
f82a202995
uninstall: Use CLI::Parser to parse args 2018-12-10 23:49:19 +05:30
Markus Reiter
16618d0fc7 Use ActiveSupport’s #pluralize and #to_sentence. 2018-10-07 23:10:56 +02:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Mike McQuaid
3a2e6b82fd Make pinning more robust
Don’t autoremove pins on uninstall or upgrade and note this in the
manpage.
2018-02-05 10:59:11 +00:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Markus Reiter
d700a5ba18 Use Formatter::pluralize where possible. 2017-05-29 17:50:13 +02:00
Mike McQuaid
566d3cb58b Document all short flags. 2017-04-02 10:14:58 +01:00
Alyssa Ross
49310667b4 Revert "uninstall: remove nil requireds/dependents"
This reverts commit d7e72899e6f24dca5e02a734d5a4e64e39fc680e.
2016-12-31 12:23:53 +00:00
Alyssa Ross
bbf53ad4ab uninstall: don't comma-seperate kegs in example
The example command given in the dependency errors/warnings previously
comma-seperated the kegs, which was incorrect syntax. This fixes that.
2016-12-30 17:45:37 +00:00
Alyssa Ross
ea3a41e213 uninstall: better example in dependency warning
Previously, this only included a subset of all the kegs the user was
trying to uninstall. With this change, all named formulae/kegs will be
included in the example command.
2016-12-30 17:44:18 +00:00
Mike McQuaid
39a0fec95d uninstall: ignore deprecations when uninstalling.
Handle `MethodDeprecatedError` because we want people to be able to
uninstall regardless of the content of their formula.
2016-11-18 09:34:58 +00:00
Mike McQuaid
d7e72899e6 uninstall: remove nil requireds/dependents
These shouldn’t get here in the first place so this is a bit of a hack
pending a better fix.
2016-11-15 14:34:49 +00:00
Alyssa Ross
ca3562645c uninstall: style fixes
Works around Rubycop not liking method names that start with `is_`
by changing convention from singular to plural.

I think it's better that way anyway.
2016-11-14 13:39:17 +00:00
Alyssa Ross
c77040b346 uninstall: clean up warnings 2016-11-14 13:09:40 +00:00
Alyssa Ross
3c310b2e3d Warn developers when uninstalling a dependency
Suggested in #1084.

Made the existing warning output entirely to STDERR, because
previously the first line went to STDERR and subsequent ones went
to STDOUT.
2016-11-14 12:13:34 +00:00
Mike McQuaid
4538d80db1 uninstall: don't need kegs to exist for --force.
Otherwise there's an error which is a regression on previous
functionality. This mirrors `rm -f` which doesn't fail if a file doesn't
exist.
2016-11-11 13:15:49 +00:00
Alyssa Ross
481a097643 uninstall: document --ignore-dependencies 2016-10-25 23:59:55 +01:00
Alyssa Ross
3702e561d6 uninstall: test should_check_for_dependents? 2016-10-25 23:53:10 +01:00
Alyssa Ross
5a3d6c4c8f uninstall, keg: update style 2016-10-25 23:48:34 +01:00
Alyssa Ross
d0ad097082 uninstall: remove duplicated method
This was moved to Keg, but looks like I forgot to get rid of it here.
2016-10-25 23:48:00 +01:00
Alyssa Ross
a4dc835ba0 uninstall: call Formula#missing_dependencies directly 2016-10-25 22:36:13 +01:00