172 Commits

Author SHA1 Message Date
Gautham Goli
164f47a108 irb: Use Parser to parse args 2018-03-24 22:18:50 +05:30
Mike McQuaid
82e82b7fbc install: add --include-test option.
Allow at `install` (or `install --only-dependencies`) time to specify
that test dependencies should be installed. This will allow simplifying
code in `brew test-bot`.

This could also be made an environment variable if desired by
maintainers.
2018-03-15 13:37:34 +00:00
Mike McQuaid
2205f62ec6 irb: add pry support.
Make `brew irb` optionally support `pry`. While doing so, also make it a `dev-cmd`.
2018-02-28 11:36:23 +00:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Mike McQuaid
01e9ec9a9f Rubocop: automatic rule fixes. 2017-09-24 21:23:59 +01:00
Josh Soref
44c56cd9a8 spelling: separated 2017-09-10 16:42:10 +00:00
Markus Reiter
2d6ae61314 Re-revert "Fix operator spacing." 2017-06-02 19:22:05 +02:00
ilovezfs
197392b56d Revert "Fix operator spacing." 2017-06-01 04:06:40 -07:00
Markus Reiter
d34ba7395b Fix operator spacing. 2017-05-31 19:53:41 +02:00
Uladzislau Shablinski
84fbcdc913 Merge pull request #2183 from vladshablinsky/questions_mean_bool
ARGV.include? should return boolean
2017-02-28 02:55:40 +03:00
Uladzislau Shablinski
be8a0b3299 ARGV.include? should return boolean 2017-02-26 13:36:20 +03:00
JCount
e84b3eaf48 ARGV: add missing "--force" arg to formula_install_option_names 2017-02-18 23:37:37 -05:00
Mike McQuaid
82f4413964 formula, ARGV: don't output duplicate formulae.
If you specify a formula more than once or it exists in the Cellar with
an alias name and the main name (e.g. `qt` and `qt5`) you can see the
same formula showing up more than once. Instead, resolve these output
lists of formulae such that they are unique based on their `name`. This
doesn't use `full_name` as it's `name` that's use for the `Cellar`.
2016-12-31 17:03:29 +00:00
Mike McQuaid
f98304026b Deprecate 32-bit options.
These were formerly supported but as it has been a very long time since
32-bit software was necessary on macOS these have been deprecated with
a `brew audit` warning and a future `odeprecated`.
2016-12-20 10:22:30 +00:00
Mike McQuaid
cc3bf7bcb5 Don't warn about unused brew install arguments.
This is a step closer to better argument handling but for now just
fixes the issue in #1217 where it starts complaining about options like
`--build-from-source` being used.
2016-11-14 09:28:28 +00:00
Alyssa Ross
c4c855b9fc ARGV: extract #values from missing 2016-10-25 22:36:13 +01:00
Josh Hagins
c7e6613f7b tap_constants: rename HOMEBREW_CASK_TAP_FORMULA_REGEX
New name is HOMEBREW_CASK_TAP_CASK_REGEX
2016-10-23 21:48:11 -04:00
Zhiming Wang
9b9e9eb8dd
ARGV: kegs: error on empty arguments
Fixes #1138.
2016-09-25 11:33:56 -04:00
Markus Reiter
6c6a4c9fa7 RuboCop: Style/AccessorMethodName 2016-09-24 19:28:26 +02:00
Markus Reiter
58e36c7319 Fix Style/GuardClause. 2016-09-24 12:24:35 +02:00
Markus Reiter
23eac7ab89 Fix DoubleNegation. 2016-09-23 15:30:06 +02:00
Alyssa Ross
2a683f2569 upgrade, outdated: follow alias changes 2016-09-18 19:58:09 +01:00
Mike McQuaid
72d10fff0b Use constants for LinkedKegs/PinnedKegs/Locks.
These definitions are scattered throughout the codebase which makes it
hard to refactor them later (my goal is to move them outside of
HOMEBREW_LIBRARY). Unify their definitions for clearer code and easier
movement later.
2016-09-15 18:28:42 +01:00
Mike McQuaid
17a7c23881 extend/ARGV: fix Rubocop warnings. 2016-09-13 07:56:57 +01:00
Vlad Shablinsky
9754dbada8
Update upgrade/outdated methods for head versions
Introduce `--fetch-HEAD` option. Without this option upgrade and
outdated never fetch latest upstream commit to detect if HEAD is
outdated -- tabs are used instead. However, if option is passed,
we fetch commit from upstream, which is more time consuming,
but we can be sure that version is up-to-date or outdated.
2016-08-06 21:25:56 +08:00
Uladzislau Shablinski
63c563f970 Fix update commit for non-HEAD kegs with head spec (#644)
If we try to call `Formulary.from_keg(f, :head)` on the keg that
is not HEAD-keg itself, we don't need to update commit of
returned formula and should use just HEAD version with nil commit.

Same is true for `ARGV.resolved_formulae`
2016-08-06 16:22:12 +08:00
Uladzislau Shablinski
092d4712a1 Update commit when resolving the formula (#536) 2016-07-17 16:56:13 +08:00
Martin Afanasjew
2633f888d4 extend/ARGV: avoid assignment in argument list
Aside from being bad style, this also assigns to an unused variable.
2016-07-17 02:31:07 +02:00
Xu Cheng
7e14ec0ba6
ARGV#kegs: using installed_prefix to locate keg 2016-07-17 02:23:37 +08:00
Xu Cheng
f811a45fe4
ARGV#resolved_formulae: check whether input is a formula file 2016-07-17 02:23:37 +08:00
Xu Cheng
7452dcf508
ARGV#resolved_formulae: also load build options 2016-07-15 19:57:23 +08:00
Martin Afanasjew
1087df1016 ARGV: fix 'value' method, make it more predictable
The fix changes behavior in same cases, but those cases were all either
broken or showed unexpected behavior. The new behavior is very simple:

- If an argument starts with `--<option-name>=`, return whatever comes
  after the equals sign.

Prior to this change, `ARGV.value` showed some unexpected behavior:

- `ARGV.value("foo")` returned `nil` for `--foo=` because at least one
  character needed to be present after the equals sign. (All other
  option parser implementations I'm aware of allow for empty values.)

- `ARGV.value("bar")` returned `"baz"` for `--foo=--bar=baz` because the
  regular expression was not anchored to the start of the argument.

- `ARGV.value("++")` raised an exception because the string wasn't
  escaped for use in the regular expression. (An unlikely corner case.)

Closes #231.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-05-12 08:09:19 +02:00
Andrew Janke
d887dd39ec brew install: make -s apply only to given formula, not deps (#205) 2016-05-06 12:02:13 -07:00
Andrew Janke
acc9a7ca85 brew test, install, update-test: add --keep-tmp option
Also enables sandbox for --interactive and --debug use of install
and test, using automatic retention.

Closes #66.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-18 12:23:08 -04:00
Martin Afanasjew
c6536066dc ARGV: remove unused 'usage' method
Also remove related helper method `Homebrew.help_s`.
2016-04-18 00:52:32 +02:00
Xu Cheng
73b79de7bc ARGV: switch? should only has one dash
If user inputs argument such as `-with-flag`, we can assume it's a bad flag.

Closes Homebrew/homebrew#49256

Closes Homebrew/homebrew#49550.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-26 16:50:55 +08:00
Martin Afanasjew
70ec2a7875 ARGV: stop supporting --homebrew-developer option
Homebrew developers have the corresponding variable permanently set in
their environment and wanting to appear like a Homebrew developer for a
single invocation is exceedingly rare. Additionally, the option won't be
recognized by `bin/brew`. (It is also undocumented.)

Using `HOMEBREW_DEVELOPER=1 brew <command>` is still possible, and not
more inconvenient than passing the `--homebrew-developer` option.

Closes Homebrew/homebrew#48322.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-02-11 13:15:37 +01:00
Mike McQuaid
307ca85e0e ARGV: add explicit option for disabling sandbox. 2015-11-10 09:09:03 +00:00
Xu Cheng
a88c40b8c8 core file style update 2015-08-22 13:15:33 +08:00
Misty De Meo
727239e12f Merge bottle install without Xcode branch
Merge branch 'bottle_hooks'
2015-08-21 11:04:22 -07:00
William Woodruff
8793a68ee4 Add no-Xcode documentation for all classes, methods 2015-08-21 11:02:33 -07:00
William Woodruff
91e598cf3f Install: add BuildToolsError and BuildFlagsError
Add these new errors, and guards in formula installation and
cmd/{,un,re}install to match, move can_build? to the MacOS module,
flatten conditions, remove redundant can_build? check

reinstate removed (doctor) check
2015-08-21 10:59:09 -07:00
Xu Cheng
e1779503b7 ARGV#resolved_formula: use to_rack 2015-08-10 21:59:50 +08:00
Vlad Shablinsky
6a0dcc8324 don't use new name rack if old name rack is a dir
Everything that used HOMEBREW_CELLAR/canonical_name
could point to something that doesn't exist because
loader_for tries to load new name formula if no old
name found. However there can be software installed
from path with the same name that renamed formulae
had and we still need to link/unlink/uninstall etc
that software. The solution is Formulary#to_rack
method that returns rack for given name.
- Add Formulary#to_rack
- Update ARGV.kegs
- Update cmd/switch
2015-08-10 13:57:59 +01:00
CNA-Bld
194618beb8 implement formulary#find_with_priority 2015-08-10 12:17:26 +01:00
Xu Cheng
df999067d6 ARGV#resolved_formulae: use canonical_name to locate rack
Closes Homebrew/homebrew#42537.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-09 20:09:57 +08:00
Misty De Meo
176e55386c ARGV: don't downcase bottle filenames
Fixes Homebrew/homebrew#42470.
2015-08-05 09:51:37 -07: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
640109f73d ARGV#resolved_formulae: auto resolve spec 2015-07-31 19:44:03 +08:00
Xu Cheng
773db6a3ba ARGV#spec: allow pass default value 2015-07-31 19:44:02 +08:00