51 Commits

Author SHA1 Message Date
Mike McQuaid
5c48226018
cmd/help: add description and arguments.
This allows an accurate manpage description of `brew help`.

Also commit the various other required changes to completions and
manpage.
2024-04-08 13:35:25 +01:00
Douglas Eichelberger
7f78fed676 rm unnecessary description 2024-03-30 16:50:28 -07:00
Douglas Eichelberger
d25956668d Fix tests 2024-03-29 19:12:25 -07:00
Douglas Eichelberger
d0c1af4f9e Port Homebrew::Cmd::Help 2024-03-29 18:53:08 -07:00
Douglas Eichelberger
d01cda2815 Turn up the types 2023-08-12 22:01:22 -07:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
6524802079 Pass remaining args to Help. 2020-08-06 16:13:14 +02:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Andrew Janke
8b55cb5ecb Refactor commands to remove "require cmd/help" 2018-06-07 04:59:59 -04:00
Mike McQuaid
4c07685258 cmd/help: usability tweaks.
- Don’t mention `brew home` or `brew options` as their output is in
  `brew info` (and the `(…|…)` is weird.
- Use full length flags for `-v` and `-d` to make more obvious what
  they are doing
- Don’t use `Developers`; instead point out it’s how you contribute
- Mention `brew commands` for `COMMAND` output (like we do with
  `FORMULA` and `brew search`)
- Point towards `docs.brew.sh`
2018-03-30 14:57:38 +01:00
Mike McQuaid
b23f66982f Improve external command documentation
Extract `brew bundle` and `brew services` docs from their help. Add a
little for `brew cask` until we can think about e.g. merging the
manpages.
2018-03-15 16:25:14 +00:00
Mike McQuaid
f2ce6489b2 Use more docs.brew.sh short links
These are nicer on the eyes.
2018-02-22 19:46:58 +00:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Mike McQuaid
baa61f5a6e Use https for all docs.brew.sh links.
May as well use the more secure link when possible.
2017-07-27 15:59:37 +01:00
Mike McQuaid
7a38bab333 Fixup all RuboCop warnings. 2017-05-29 18:43:18 +01:00
Mike McQuaid
a3bffe70bc Use docs.brew.sh links. 2017-01-04 11:13:41 +00:00
Markus Reiter
cafe149780 Merge pull request #1145 from reitermarkus/module-function
Use `module_function` for `Homebrew` module.
2016-10-04 10:31:49 +02:00
Mike McQuaid
f90f52d902 Merge pull request #1205 from MikeMcQuaid/help-external-commands
help: support `#:` help in external commands.
2016-10-02 08:59:32 +01:00
Markus Reiter
c36f42ce95 Remove private_class_method from commands. 2016-10-02 00:24:47 +02:00
Markus Reiter
0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Markus Reiter
884b268506 Use Formatter for all URLs. 2016-10-01 20:00:49 +02:00
Markus Reiter
6d8ee395fa Refactor Tty. 2016-10-01 20:00:49 +02:00
Mike McQuaid
a4ebda3fc4 help: support #: help in external commands.
Fixes https://github.com/Homebrew/homebrew-test-bot/issues/3
2016-10-01 18:25:16 +01:00
Mike McQuaid
b85ee1cb8f Update documentation links. 2016-09-20 10:41:42 +01:00
Mike McQuaid
d9b8d0f6b1 cmd/help: fix Rubocop warnings. 2016-09-11 17:58:59 +01:00
Mike McQuaid
027086d673 help: rename help section for developers. 2016-09-08 20:48:38 +01:00
Mike McQuaid
ae57057afa help: use Commands module. 2016-09-08 20:46:55 +01:00
Mike McQuaid
4f6bae46f9 cmd/*: don't restrict dev-cmd to Homebrew developers. 2016-09-08 20:46:37 +01:00
Tim D. Smith
9b36e83771 Add magic token to hide commands from man page
Closes #402.
2016-06-29 09:01:36 -07:00
Martin Afanasjew
742df8bbf4 Reorder usage examples for brew help
- Reorder listed commands to better reflect a typical workflow (search,
  then query for details via `info` and friends, then install, later
  update and upgrade, at last maybe uninstall).
- Remove niche `pin` and `unpin` commands.
- Drop `--env` in the Troubleshooting section.

And use `/REGEX/` instead of `/PATTERN/` to be clearer what is expected.

Closes #177.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-05-05 23:35:54 +02:00
Martin Afanasjew
cf3486f98a help: show command-specific help for invalid usage
Instead of always printing the generic help text, print command-specific
help if it is available and a command raised the `UsageError` exception.
Put the error message underneath the help text (was above) to avoid that
it scrolls off the screen.

Thereby fix a regression where handling the invalid usage would fail to
access `ARGV.usage` removed in c6536066dc39da653d265640c6ba6046bb5def98.
2016-04-20 13:46:10 +02:00
Martin Afanasjew
557ad956fd help: refactor (again) and fix code style issues
Turns out making `empty_argv` a boolean argument for `Homebrew.help` was
not the best idea and having command-to-path mapping and help extraction
in a single method is not flexible enough.

Also only complain about missing help text when `HOMEBREW_DEVELOPER=1`
and otherwise just print the generic help text.
2016-04-20 13:46:10 +02:00
Martin Afanasjew
4f8e3cae5e help: improve styling of generic help text
Format the usage examples more consistently (particularly parentheses
instead of square brackets where one of several alternatives has to be
picked). And add the now much more useful `brew help <command>`.

Closes #113.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-20 13:45:26 +02: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
Martin Afanasjew
3503806e77 help: handle help output (move from 'brew.rb')
Keep the footprint of `brew.rb` small. Handle fetching/displaying an
appropriate help text (taking into account various external conditions)
in the `help` command.
2016-04-18 00:52:32 +02:00
Xu Cheng
c1427fd295 help: support highlighted output
Closes #68.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-04-12 17:57:18 +08:00
Xu Cheng
af1eb007e2 help: handle alias
Before this fix
```
$ brew --help ls
Error: Unknown command: ls
```

After this fix
```
$ brew --help ls
brew list, ls
<snip>
```
2016-04-12 14:29:49 +08:00
Max Nordlund
b21f699ff2 Implement the brew help command
This is also used by `brew <cmd> --help`. The basic idea is to have the
documentation as a top level comment in each command file. To find these
comments, they have to be like this `#:`.

This is also used by the `brew man` command to keep the documentation
DRY, and for that there are now a header and footer for the man page.
2016-04-10 22:59:24 +02:00
Mike McQuaid
276a797d37 Update documentation after repository split. 2016-04-03 14:03:33 +01:00
Xu Cheng
8fecd4c198 help: remove obsoleted argument 2015-08-07 19:36:29 +08: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
Jack Nagel
621a7ada95 Remove reference to "open" command
Closes Homebrew/homebrew#40706.
2015-06-15 20:08:46 -04:00
Xu Cheng
1f7c4ee644 replace brew upgrade with brew upgrade --all. 2015-05-06 16:19:07 +08:00
Mike McQuaid
19d12aee45 Import docs from wiki.
Closes Homebrew/homebrew#33211.
2014-10-26 14:57:36 +00:00
Jack Nagel
10a1952d2c Only "extend self" once on the Homebrew module 2014-06-19 13:10:36 -05:00
Adam Vandenberg
d4b0599a86 --config -> config 2014-04-30 19:09:29 -07:00
Mike McQuaid
d7c13f84b6 Update string references to mxcl/homebrew. 2013-12-14 18:18:35 +00:00
Stan
4d086e8394 add pin/unpin to help
Closes Homebrew/homebrew#23267.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-10-16 06:08:19 -07:00
Charlie Sharpsteen
1fbc32d842 brew-help: Add options to example usage
Also, move the line containing `info`, `home` and `options` to the top of the
list as users should be running these before installation.

Ref. Homebrew/homebrew#13224.
2013-01-30 09:31:42 -08:00
Max Howell
19e387d92e brew upgrade
Consequence: you can no longer install when something is already installed, you must upgrade it. This doesn't apply if the formula in question was unlinked. You can still --force installs though.

Rationale: the old way of installing over the top would leave symlinks to multiple versions in /usr/local if the old version had a file the newer version didn't. The new upgrade command handles everything properly.
2011-08-24 22:30:43 +01:00