-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stub Ruby commands for all Bash commands.
This gets us pretty similar (but easier to manage) manpage output but much nicer completions etc. for all these commands.
- Loading branch information
1 parent
988c44c
commit b93d771
Showing
26 changed files
with
554 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "abstract_command" | ||
|
||
module Homebrew | ||
module Cmd | ||
class Version < AbstractCommand | ||
sig { override.returns(String) } | ||
def self.command_name = "--version" | ||
|
||
cmd_args do | ||
description <<~EOS | ||
Print the version numbers of Homebrew, Homebrew/homebrew-core and | ||
Homebrew/homebrew-cask (if tapped) to standard output. | ||
EOS | ||
end | ||
|
||
sig { override.void } | ||
def run = raise_sh_command_error! | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "abstract_command" | ||
|
||
# This Ruby command exists to allow generation of completions for the Bash | ||
# version. It is not meant to be run. | ||
module Homebrew | ||
module Cmd | ||
class Casks < AbstractCommand | ||
cmd_args do | ||
description "List all locally installable casks including short names." | ||
end | ||
|
||
sig { override.void } | ||
def run = raise_sh_command_error! | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "abstract_command" | ||
|
||
module Homebrew | ||
module Cmd | ||
class Formulae < AbstractCommand | ||
cmd_args do | ||
description "List all locally installable formulae including short names." | ||
end | ||
|
||
sig { override.void } | ||
def run = raise_sh_command_error! | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "abstract_command" | ||
|
||
module Homebrew | ||
module Cmd | ||
class SetupRuby < AbstractCommand | ||
cmd_args do | ||
description <<~EOS | ||
Installs and configures Homebrew's Ruby. If `command` is passed, it will only run Bundler if necessary for that command. | ||
EOS | ||
|
||
named_args :command | ||
end | ||
|
||
sig { override.void } | ||
def run = raise_sh_command_error! | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "abstract_command" | ||
|
||
module Homebrew | ||
module Cmd | ||
class Shellenv < AbstractCommand | ||
cmd_args do | ||
description <<~EOS | ||
Valid shells: bash|csh|fish|pwsh|sh|tcsh|zsh | ||
Print export statements. When run in a shell, this installation of Homebrew will be added to your `PATH`, `MANPATH`, and `INFOPATH`. | ||
The variables `HOMEBREW_PREFIX`, `HOMEBREW_CELLAR` and `HOMEBREW_REPOSITORY` are also exported to avoid querying them multiple times. | ||
To help guarantee idempotence, this command produces no output when Homebrew's `bin` and `sbin` directories are first and second | ||
respectively in your `PATH`. Consider adding evaluation of this command's output to your dotfiles (e.g. `~/.bash_profile` or | ||
`~/.zprofile` on macOS and `~/.bashrc` or `~/.zshrc` on Linux) with: `eval "$(brew shellenv)"` | ||
The shell can be specified explicitly with a supported shell name parameter. Unknown shells will output POSIX exports. | ||
EOS | ||
named_args :shell | ||
end | ||
|
||
sig { override.void } | ||
def run = raise_sh_command_error! | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "abstract_command" | ||
|
||
module Homebrew | ||
module Cmd | ||
class UpdateReset < AbstractCommand | ||
cmd_args do | ||
description <<~EOS | ||
Fetch and reset Homebrew and all tap repositories (or any specified <repository>) using `git`(1) to their latest `origin/HEAD`. | ||
*Note:* this will destroy all your uncommitted or committed changes. | ||
EOS | ||
|
||
named_args :tap | ||
end | ||
|
||
sig { override.void } | ||
def run = raise_sh_command_error! | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "abstract_command" | ||
|
||
module Homebrew | ||
module Cmd | ||
class Update < AbstractCommand | ||
cmd_args do | ||
description <<~EOS | ||
Fetch the newest version of Homebrew and all formulae from GitHub using `git`(1) and perform any necessary migrations. | ||
EOS | ||
switch "--merge", | ||
description: "Use `git merge` to apply updates (rather than `git rebase`)." | ||
switch "--auto-update", | ||
description: "Run on auto-updates (e.g. before `brew install`). Skips some slower steps." | ||
switch "-f", "--force", | ||
description: "Always do a slower, full update check (even if unnecessary)." | ||
switch "-q", "--quiet", | ||
description: "Make some output more quiet." | ||
switch "-v", "--verbose", | ||
description: "Print the directories checked and `git` operations performed." | ||
switch "-d", "--debug", | ||
description: "Display a trace of all shell commands as they are executed." | ||
end | ||
|
||
sig { override.void } | ||
def run = raise_sh_command_error! | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "abstract_command" | ||
|
||
module Homebrew | ||
module Cmd | ||
class VendorInstall < AbstractCommand | ||
cmd_args do | ||
description <<~EOS | ||
Install Homebrew's portable Ruby. | ||
EOS | ||
|
||
named_args :target | ||
|
||
hide_from_man_page! | ||
end | ||
|
||
sig { override.void } | ||
def run = raise_sh_command_error! | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "abstract_command" | ||
|
||
module Homebrew | ||
module Cmd | ||
class Rubocop < AbstractCommand | ||
cmd_args do | ||
description <<~EOS | ||
Installs, configures and runs Homebrew's `rubocop`. | ||
EOS | ||
end | ||
|
||
sig { override.void } | ||
def run = raise_sh_command_error! | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.