138 Commits

Author SHA1 Message Date
Markus Reiter
096377abf2 Pass args correctly in brew deps and brew uses. 2020-07-31 19:10:45 +02:00
William Ma
e05538a7d9 Create DependenciesHelpers file, add tests 2020-07-31 11:35:45 -04:00
Markus Reiter
d4c2ffd705 Refactor CLI::Parser. 2020-07-31 15:07:17 +02:00
William Ma
7be2b943cb uses: Print cask uses 2020-07-30 12:59:01 -04:00
Mike McQuaid
17fb1b6dd8
cmd/deps: add missing require.
Fixes https://github.com/Homebrew/brew/pull/8126#issuecomment-666345260
2020-07-30 14:20:58 +01:00
William Ma
4216da7629 deps: Move CaskDependencies to its own file 2020-07-29 09:38:07 -04:00
William Ma
cc63cece76 deps: print cask dependencies
* Allow references to commands when using `brew deps`, e.g. `brew deps
cellery`
* Fix crash when using `brew deps <formula> --installed
--include-requirements`
* Do not include runtime dependencies as direct dependencies when using
`--tree`
2020-07-28 20:24:19 -04:00
Markus Reiter
cfbe1fb3c7 Add helper functions for deps and uses explicitly. 2020-07-25 02:37:10 +02:00
Mike McQuaid
a7fe0ed847
cmd: use more and cleanup new args APIs. 2020-03-05 09:40:15 +00:00
Dawid Dziurla
967b9b8112
deps: give consistent results
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
2020-02-12 22:38:20 +01:00
EricFromCanada
c31335c46d deps: don't skip those that are both :build and :test
plus a code readability improvement
2019-12-27 17:35:18 -05:00
Gautham Goli
22e25dd593 argv: move formulae to cli/args 2019-12-11 16:36:23 +05:30
Mike McQuaid
5cca9b75a8
deps: use runtime_dependencies more readily.
If all the passed packages are currently installed then use
`runtime_dependencies` to get dependency data more quickly and
accurately.

As discussed in https://github.com/Homebrew/brew/issues/6769.
2019-11-27 12:36:21 +00:00
Mike McQuaid
1224f56511
deps: refactor weird OpenStruct usage. 2019-11-06 11:10:22 +00:00
Mike McQuaid
b6116c5a03
deps: use Formulary factory cache. 2019-11-06 10:21:28 +00:00
EricFromCanada
8a8359cdd4 manpages: sentence rewording for readability
Use active voice when applicable, better verbs & adjectives, preposition usage, proper tense, etc.
2019-08-20 09:05:45 -04:00
EricFromCanada
ee314617f7 manpages: update command usage strings 2019-08-20 08:55:54 -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
EricFromCanada
f97f7b615e deps: allow passing both --installed & --include-requirements
And update docs.
2019-03-14 21:00:21 -04:00
EricFromCanada
23c62b8b83 deps: fix --1 and --annotate options 2019-03-07 16:39:42 -05:00
Mike McQuaid
d64429a736
rubocop: enable Style/IfUnlessModifier. 2019-02-21 12:55:49 +00:00
Mike McQuaid
6cb7a00f2d
cmd: remove --help headers and tweak docs. 2019-01-30 21:39:28 +00:00
Mike McQuaid
51a260cf1c
deps: accept formula options.
Also, cleanup usage of `<formula>`.

As requested in comments of #5587.
2019-01-30 13:18:02 +00:00
Mike McQuaid
867b155479
Add missing conflicts to command options. 2019-01-29 19:39:41 +00:00
Gautham Goli
7b6d1f774d
deps: Use CLI::Parser to parse args 2019-01-23 08:34:24 +05:30
Bryce Glover
fc40e2fa40 brew deps: Fix typo in --include-optional output.
This was missing its closing square bracket.
2018-11-12 17:56:06 -05:00
Mike McQuaid
737b84b54b
brew style --fix fixes. 2018-11-02 17:29:23 +00:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Mike McQuaid
80d75bc0d8
Homebrew/.rubocop: tweak rules.
Adjust the rules based on the current codebase. Remove various enable,
disables and default values that are unnecessary. Add more comments
explaining why. Make minor changes needed to enable a few more rules.
2018-09-02 20:15:09 +01:00
Mike McQuaid
74d6d39e45 deps: use Formula#runtime_dependencies. 2018-03-27 14:52:48 +01:00
Mike McQuaid
592bafe24e Refactor dependencies usage
Reuse more code to avoid errors due to duplication.
2018-03-24 16:55:16 +00:00
Mike McQuaid
1dfeff7274 deps: don't display recursive test dependencies.
You only care about the test dependencies for the specific formula you
are testing right now.
2018-03-14 15:41:20 +00:00
Mike McQuaid
924c4af3de dep*: fix more :test dependency resolution. 2018-03-08 09:46:53 +00:00
Mike McQuaid
d32fc4508f deps: fix test? typo. 2018-03-08 08:36:01 +00:00
Mike McQuaid
fea9bc1e42 Allow :test dependencies.
These specify that they are needed by the test block. This can be
combined with `:build` to ensure that this formula isn't uninstalled
by `brew test-bot` when running `test do` blocks on our CI.
2018-03-05 10:36:39 +00:00
Mike McQuaid
b70b5429d0 Deprecate default_formula Requirement DSL
This has been a nightmare in terms of the complexity to our dependency
system and the whack-a-mole required on bugs. If a Requirement resolves
to a Formula it should just use `depends_on "formula"` instead. This
matches the effective behaviour all users of bottles (the vast majority
of users and installs) and what we're doing in Homebrew/homebrew-core.
2018-01-14 13:27:43 +00:00
Dominyk Tiller
c9684c3727
deps: pass explicit sort to handle APFS 2017-10-14 06:42:53 +01:00
Andrew Janke
bb85581df0 brew deps: add --include-requirements 2017-08-11 16:43:37 -04:00
Mike McQuaid
7a38bab333 Fixup all RuboCop warnings. 2017-05-29 18:43:18 +01:00
Alyssa Ross
9e97eadccb rubocop: trailing comma in multiline method calls
Discussed in
https://github.com/Homebrew/brew/pull/1987/files#r100693581.

This was originally ommitted because it wasn't compatible with Ruby 1.8.
(See https://github.com/Homebrew/legacy-homebrew/pull/48144#r49928971).
2017-02-12 15:11:38 +00:00
Andrew Janke
62d48b4f9d brew deps --tree: fix gap in line between reqs and deps 2017-01-12 16:08:41 -05:00
Andrew Janke
0097dbe4ee brew deps: support --full-name in --installed, --all, and --tree modes 2016-12-27 23:41:16 -05:00
Markus Reiter
0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Mike McQuaid
6f3039fcd3 cmd/deps: avoid some full-name code repetition. 2016-08-30 18:49:27 +01:00
Steven Peters
7ddd3977d8 cmd/deps.rb add --full-name option
Add --full-name option to brew deps command,
which displays the full name of dependencies.
2016-08-28 00:30:30 -07:00
ilovezfs
6367508454 deps should respect skip-recommended
For example, `brew deps libass --skip-recommended` shouldn't print
harfbuzz because, even though libass builds with harfbuzz when harfbuzz
is not skipped, we asked to skip recommended, of which harfbuzz is one.

The corresponding change is made for `brew uses` as well.

Thanks to Xu Cheng for contributing the code. Any errors are mine.

Closes #129.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-06-11 01:26:28 -07:00
Martin Afanasjew
6fdcab5abc deps: split and clarify documentation
`brew deps` has three different modes of operation that were not easy to
infer from the existing documentation. Split the help text into three
parts to make this clearer. This also improves on the confusion when
options were silently ignored because they don't apply to a certain mode
of operation. Those are:

1. List the shared dependencies (either intersection or union) of
   explicitly named formulae with options for traversal depth/order.

2. Output separate trees of explicitly listed or all installed formulae.

3. List all available/installed formulae and their direct dependencies
   with one line per formula formatted as `<formula>: <dependencies>`.

Closes #137.

Closes #179.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-05-03 17:19:18 +02:00