Commit Graph
77 Commits
Author SHA1 Message Date
Adam Vandenberg 58a1aa75d6 Update fetch bash completion
Also complete --devel and the formula's install options.
2013-06-12 15:58:12 -07:00
Adam Vandenberg 743c8286bf Add brew search --debian <f> 2013-05-27 17:32:27 -07:00
Jack Nagel 88026dce52 Fix completion of install options without formula
Fixes #20084.
2013-05-25 18:28:54 -05:00
Jaime Marquínez Ferrándiz 1f681d9953 brew_bash_completion: complete --force for brew link
Closes #19828.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-05-15 06:38:09 -07:00
Jack Nagel 819fb643bd completion: avoid unnecessary brew invocations 2013-04-30 01:24:11 -05:00
Robson Peixoto 11c8d7132b Add tap --repair to bash completion script
Closes #19113.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-04-11 02:08:30 -05:00
Jaime Marquínez Ferrándiz 9eae152165 Fix typo for pin command in bash_completion
Closes #18849.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-03-30 16:22:55 -07:00
Simon Sigurdhsson 85eb73ced7 brew-pin: prevent selected formulae from upgrade.
* Added `pin` et. al. to manpage.
* Added `brew pin` to `brew.1` * Added `brew unpin` to `brew.1`
* Added `brew list --pinned` to `brew.1`
* Added information about frozen formulae to `brew upgrade` in `brew.1`
* Added `pin` et.al. to completion scripts.
* Unpin formulae when uninstalling them
* Unpin and re-pin formulae when upgrading (avoids stale symlink)

References #18386.
Closes #18515.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-03-30 19:50:47 +00:00
Mike McQuaid a6324cb761 Rename Library/Contributions/cmds -> cmd. 2013-02-18 10:42:44 +00:00
Adam Vandenberg 79e776cb51 Add 'instal' to completions 2013-01-29 11:13:23 -08:00
Jack Nagel 5119803c00 Document some recently added options 2012-11-13 16:56:49 -06:00
Jack Nagel 976366e5ed bash completion for doctor checks 2012-11-13 16:49:43 -06:00
Misty De Meo 5047c85ced brew-test-bot: move html and css into subdirectory
Also updates the bash-completion to ignore subdirectories, rather than
specific filename patterns.
2012-07-18 08:25:07 -05:00
Misty De Meo 30f93e2690 bash-completion: hide brew-bot support files
Hides files with the extensions ".css" and ".erb" to ensure that the
brew-bot's support files don't show up in tab-completion.
2012-07-17 23:29:28 -05:00
Jack Nagel 2af120b2bd Restore completion for "link" and "ln"
Commit 3b5d7939d9 added completion for
`brew link` options, but disabled completion of the actual command
itself.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-12 02:41:12 -05:00
Adam Vandenberg 3b5d7939d9 Add completions for brew link 2012-07-11 20:08:09 -07:00
Jack Nagel 58bdd43c41 Completion for "brew missing"
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-13 08:14:25 -05:00
Jack Nagel b7b027855d Use "legacy" search API when completing tap names
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-12 11:58:48 -05:00
Misty De Meo d727f8b7f3 Replace /usr/bin/ruby with full Framework path
Rationale: some users insist on replacing the /usr/bin/ruby symlink
to point to another ruby on their system, which may break homebrew.
Use the full Framework path instead, which is less likely to be tampered with.

This also reorganizes the brew --config checks to reflect the different path.

Fixes #12009.

Closes #12333.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-06-01 09:24:25 -05:00
Jack Nagel ffb9aa5413 Remove "__brew_ps1" function from completion
This was probably silly and I'm probably the only person that ever used
it. I still do, actually, but it's not really a completion function,
it's simple enough to just stick in a shell startup script, and removing
it makes the completion script usable under the new dynamic loading
scheme provided by bash-completion 1.99+.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-29 20:11:00 -05:00
Jack Nagel 37e8c5cfb7 Tab completion for brew tap
Using an inline Ruby script we can hit the GitHub API and look for
repositories that match the tap naming scheme. The results are cached
for the duration of the current shell session, so going over the network
is a once-per-shell-session cost.

There are a few false positives, but not much we can do about that at
this point, as taps do not have to be in the fork network of any
specific repository.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-23 22:42:43 -05:00
Mike McQuaid b27b761931 Rename external commands directory from examples.
Fixes #10829.
2012-03-18 15:34:41 +13:00
Jack Nagel 406582dcad Tab completion for tapped formulae
So you can do e.g.

    $ brew install adamv<TAB>
    Display all 106 possibilities? (y or n)
    $ brew install adamv/alt/openss<TAB>
    adamv/alt/openssh     adamv/alt/openssl098  adamv/alt/openssl100

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-16 19:18:58 -05:00
Jack Nagel 19f1a328e3 Appease the masses
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-16 19:18:54 -05:00
Jack Nagel 5e87705093 Bash completion for brew untap
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-16 16:52:35 -05:00
Jack Nagel 22d1c07bd1 Refactor the bash completion script
The script was lacking structure and had grown a number of one-off hacks
that would be better as reusable functions. So,

 - give each subcommand that has completions it's own function
 - move completion of formulae, installed brews, and outdated brews into
   reusable functions
 - introduce a general __brewcomp() function that takes a string of tab,
   space, and/or newline separated items and converts all seperators to
   newlines, and then generates a reply with compgen().

These changes should allow for easier addition of new features in the
future.

As a bonus, completion for `brew log` will include git-log options if
the git completion script is also loaded.

_brew_to_completion() is kept around for compatiblity.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-25 23:04:08 -06:00
Jack Nagel 2738ff352f Complete options for brew -S
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-08 13:24:35 -06:00
Jack Nagel b26e66fa46 versions: enable '--compact' output
This will be useful for shell tab completion when something like `brew
install <formula> --version <version>` is implemented.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-06 14:51:15 -06:00
Jack Nagel 078fa4b37a completion: audit takes formula arguments
- Also remove `--strict` completion since that option was removed.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-12-11 01:49:47 -06:00
Jack Nagel 96da368fc5 completion: complete multiple formula arguments
We make the assumption that the first non-option word is the command
being invoked.

Originally I was trying to allow command completion for non-standard
command lines like

    $ brew --verbose inst<TAB>

but right now executing something like that doesn't actually work. Which
is interesting, because the man page implies that it should. Either the
man page is incorrect, or something was broken between then and now.

Anyway, it would probably be safe to just assume that COMP_WORDS[1] is
the command, and we do make that assumption in other places. But if we
ever do allow things like "brew --option command", this will be useful.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-12-11 01:49:47 -06:00
Jack Nagel 6b6dc1028f Document 'install --devel'
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-28 14:43:54 -06:00
Jack Nagel c5639788e2 Move brew-depstree into brew deps --tree
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-27 23:29:41 -06:00
Charlie Sharpsteen 16b8267f4a Add --fresh option to brew install
When invoked, this option will ensure brew doesn't re-use any options from
previous installs of a formula.
2011-11-14 10:44:18 -08:00
Jack Nagel 742fffbb19 completion: add __brew_ps1 to annotate $PS1
It is often useful to be reminded that you are, in fact, in the middle
of a debug or interactive install. We provided this reminder in the form
of HOMEBREW_DEBUG_INSTALL, but we can make this even easier for the end
user to consume by exposing it in the form of a shell function.

When HOMEBREW_DEBUG_INSTALL is set, the __brew_ps1() function returns
the string "(formula_name|DEBUG)" by default (much like the __git_ps1()
output when performing some long-running operation, e.g.
"(branch|REBASE-i)". The formatting around "formula_name|DEBUG" can be
customized by passing a format string to the function.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-11 00:01:05 -06:00
Jack Nagel 62223aca5e Add bash completion for subcommand options
We already have option completion for `brew install`; now we have it for
all core commands, and the --cache, --cellar, and --prefix flags now
have appropriate formula completion.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-12 02:57:28 -05:00
Jack Nagel 65b2335935 Fix syntax error in the bash-completion script
My bad.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-09 13:40:49 -05:00
Jack Nagel 99387117a0 Make bash completion for upgrade smarter
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-08 20:30:10 -05:00
Jack Nagel a110f5ed23 Fix alpha-order mistake in brew bash-completion
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-08-29 10:31:45 -05:00
Jack Nagel 1018edfc66 Add upgrade to the bash-completion script
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-08-28 14:12:53 -05:00
Jack Nagel 8ebfe66556 Document HOMEBREW_BUILD_FROM_SOURCE
Additionally, add '--build-from-source' to the bash-completion script.
2011-08-25 00:08:30 -05:00
Charlie Sharpsteen a36ae37d4b Contribution: Tweak bash completion for install
Selection of generic installation options, such as `--HEAD`, is now lumped
together with selection of formulae-specific options.

This allows any installation option to be tab-completed *before or after* the
formula name is specified.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-08-17 23:23:20 -07:00
Sebastian Staudt 0b1f677b82 Added new command "versions" 2011-08-02 10:35:30 +01:00
Adam Vandenberg a97f001075 Add --use-clang to completion script. 2011-06-16 20:58:06 -07:00
Adam Vandenberg 810f604d99 Add remove back to completion 2011-05-14 10:16:52 -07:00
Jack Nagel 489b589a13 Update bash completion script
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-05-04 19:23:39 -07:00
Adam Vandenberg 61c3a7bdb2 brew missing: allow a formula argument
If a formula is given, it will be checked for missing deps.
The formula does not have to be installed first.

Without a formula list, still checks all installed brews.
2011-04-13 13:48:31 -07:00
Adam Vandenberg f6726a8367 Add audit to bash completion 2011-03-31 11:09:45 -07:00
Adam Vandenberg b66b6c6b20 add --verbose to brew install completion 2011-03-21 12:42:10 -07:00
Adam Vandenberg 630112f3af Add --use-gcc to bash completion 2011-03-16 16:31:39 -07:00
Justin Hileman 3c25722e51 Handle default install --options
i.e. `--force --debug --use-llvm --ignore-dependencies --HEAD`

Additionally:

 * Use a cleaner `if` block in install options completion case.
 * De-dupe options for subsequent completion (e.g. stop offering --foo once
   --foo option has been used).

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-02-09 17:44:01 -08:00