Skip to content

Commit

Permalink
brew: added missing commands
Browse files Browse the repository at this point in the history
- still missing completions
  • Loading branch information
rsteube committed Feb 7, 2024
1 parent 7103508 commit ed20a98
Show file tree
Hide file tree
Showing 111 changed files with 3,020 additions and 210 deletions.
32 changes: 32 additions & 0 deletions completers/brew_completer/cmd/abv.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var abvCmd = &cobra.Command{
Use: "abv",
Short: "Display brief statistics for your Homebrew installation",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(abvCmd).Standalone()

abvCmd.Flags().Bool("analytics", false, "List global Homebrew analytics data or, if specified, installation and build error data for <formula> (provided neither `HOMEBREW_NO_ANALYTICS` nor `HOMEBREW_NO_GITHUB_API` are set).")
abvCmd.Flags().Bool("cask", false, "Treat all named arguments as casks.")
abvCmd.Flags().Bool("category", false, "Which type of analytics data to retrieve. The value for <category> must be `install`, `install-on-request` or `build-error`; `cask-install` or `os-version` may be specified if <formula> is not. The default is `install`.")
abvCmd.Flags().Bool("days", false, "How many days of analytics data to retrieve. The value for <days> must be `30`, `90` or `365`. The default is `30`.")
abvCmd.Flags().Bool("debug", false, "Display any debugging information.")
abvCmd.Flags().Bool("eval-all", false, "Evaluate all available formulae and casks, whether installed or not, to print their JSON. Implied if `HOMEBREW_EVAL_ALL` is set.")
abvCmd.Flags().Bool("formula", false, "Treat all named arguments as formulae.")
abvCmd.Flags().Bool("github", false, "Open the GitHub source page for <formula> and <cask> in a browser. To view the history locally: `brew log -p` <formula> or <cask>")
abvCmd.Flags().Bool("help", false, "Show this message.")
abvCmd.Flags().Bool("installed", false, "Print JSON of formulae that are currently installed.")
abvCmd.Flags().Bool("json", false, "Print a JSON representation. Currently the default value for <version> is `v1` for <formula>. For <formula> and <cask> use `v2`. See the docs for examples of using the JSON output: <https://docs.brew.sh/Querying-Brew>")
abvCmd.Flags().Bool("quiet", false, "Make some output more quiet.")
abvCmd.Flags().Bool("variations", false, "Include the variations hash in each formula's JSON output.")
abvCmd.Flags().Bool("verbose", false, "Show more verbose analytics data for <formula>.")
rootCmd.AddCommand(abvCmd)
}
23 changes: 23 additions & 0 deletions completers/brew_completer/cmd/analytics.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var analyticsCmd = &cobra.Command{
Use: "analytics",
Short: "Control Homebrew's anonymous aggregate user behaviour analytics",
GroupID: "main",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(analyticsCmd).Standalone()

analyticsCmd.Flags().Bool("debug", false, "Display any debugging information.")
analyticsCmd.Flags().Bool("help", false, "Show this message.")
analyticsCmd.Flags().Bool("quiet", false, "Make some output more quiet.")
analyticsCmd.Flags().Bool("verbose", false, "Make some output more verbose.")
rootCmd.AddCommand(analyticsCmd)
}
45 changes: 45 additions & 0 deletions completers/brew_completer/cmd/audit.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var auditCmd = &cobra.Command{
Use: "audit",
Short: "Check <formula> for Homebrew coding style violations",
GroupID: "developer",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(auditCmd).Standalone()

auditCmd.Flags().Bool("arch", false, "Audit the given CPU architecture. (Pass `all` to audit all architectures.)")
auditCmd.Flags().Bool("audit-debug", false, "Enable debugging and profiling of audit methods.")
auditCmd.Flags().Bool("cask", false, "Treat all named arguments as casks.")
auditCmd.Flags().Bool("debug", false, "Display any debugging information.")
auditCmd.Flags().Bool("display-filename", false, "Prefix every line of output with the file or formula name being audited, to make output easy to grep.")
auditCmd.Flags().Bool("eval-all", false, "Evaluate all available formulae and casks, whether installed or not, to audit them. Implied if `HOMEBREW_EVAL_ALL` is set.")
auditCmd.Flags().Bool("except", false, "Specify a comma-separated <method> list to skip running the methods named `audit_`<method>.")
auditCmd.Flags().Bool("except-cops", false, "Specify a comma-separated <cops> list to skip checking for violations of the listed RuboCop cops.")
auditCmd.Flags().Bool("fix", false, "Fix style violations automatically using RuboCop's auto-correct feature.")
auditCmd.Flags().Bool("formula", false, "Treat all named arguments as formulae.")
auditCmd.Flags().Bool("git", false, "Run additional, slower style checks that navigate the Git repository.")
auditCmd.Flags().Bool("help", false, "Show this message.")
auditCmd.Flags().Bool("installed", false, "Only check formulae and casks that are currently installed.")
auditCmd.Flags().Bool("new", false, "Run various additional style checks to determine if a new formula or cask is eligible for Homebrew. This should be used when creating new formulae or casks and implies `--strict` and `--online`.")
auditCmd.Flags().Bool("no-signing", false, "Audit for signed apps, which are required on ARM")
auditCmd.Flags().Bool("online", false, "Run additional, slower style checks that require a network connection.")
auditCmd.Flags().Bool("only", false, "Specify a comma-separated <method> list to only run the methods named `audit_`<method>.")
auditCmd.Flags().Bool("only-cops", false, "Specify a comma-separated <cops> list to check for violations of only the listed RuboCop cops.")
auditCmd.Flags().Bool("os", false, "Audit the given operating system. (Pass `all` to audit all operating systems.)")
auditCmd.Flags().Bool("quiet", false, "Make some output more quiet.")
auditCmd.Flags().Bool("signing", false, "Audit for signed apps, which are required on ARM")
auditCmd.Flags().Bool("skip-style", false, "Skip running non-RuboCop style checks. Useful if you plan on running `brew style` separately. Enabled by default unless a formula is specified by name.")
auditCmd.Flags().Bool("strict", false, "Run additional, stricter style checks.")
auditCmd.Flags().Bool("tap", false, "Check the formulae within the given tap, specified as <user>`/`<repo>.")
auditCmd.Flags().Bool("token-conflicts", false, "Audit for token conflicts.")
auditCmd.Flags().Bool("verbose", false, "Make some output more verbose.")
rootCmd.AddCommand(auditCmd)
}
24 changes: 24 additions & 0 deletions completers/brew_completer/cmd/autoremove.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var autoremoveCmd = &cobra.Command{
Use: "autoremove",
Short: "Uninstall formulae that were only installed as a dependency of another formula and are now no longer needed",
GroupID: "main",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(autoremoveCmd).Standalone()

autoremoveCmd.Flags().Bool("debug", false, "Display any debugging information.")
autoremoveCmd.Flags().Bool("dry-run", false, "List what would be uninstalled, but do not actually uninstall anything.")
autoremoveCmd.Flags().Bool("help", false, "Show this message.")
autoremoveCmd.Flags().Bool("quiet", false, "Make some output more quiet.")
autoremoveCmd.Flags().Bool("verbose", false, "Make some output more verbose.")
rootCmd.AddCommand(autoremoveCmd)
}
36 changes: 36 additions & 0 deletions completers/brew_completer/cmd/bottle.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var bottleCmd = &cobra.Command{
Use: "bottle",
Short: "Generate a bottle (binary package) from a formula that was installed with `--build-bottle`",
GroupID: "developer",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(bottleCmd).Standalone()

bottleCmd.Flags().Bool("committer", false, "Specify a committer name and email in `git`'s standard author format.")
bottleCmd.Flags().Bool("debug", false, "Display any debugging information.")
bottleCmd.Flags().Bool("force-core-tap", false, "Build a bottle even if <formula> is not in `homebrew/core` or any installed taps.")
bottleCmd.Flags().Bool("help", false, "Show this message.")
bottleCmd.Flags().Bool("json", false, "Write bottle information to a JSON file, which can be used as the value for `--merge`.")
bottleCmd.Flags().Bool("keep-old", false, "If the formula specifies a rebuild version, attempt to preserve its value in the generated DSL.")
bottleCmd.Flags().Bool("merge", false, "Generate an updated bottle block for a formula and optionally merge it into the formula file. Instead of a formula name, requires the path to a JSON file generated with `brew bottle --json` <formula>.")
bottleCmd.Flags().Bool("no-all-checks", false, "Don't try to create an `all` bottle or stop a no-change upload.")
bottleCmd.Flags().Bool("no-commit", false, "When passed with `--write`, a new commit will not generated after writing changes to the formula file.")
bottleCmd.Flags().Bool("no-rebuild", false, "If the formula specifies a rebuild version, remove it from the generated DSL.")
bottleCmd.Flags().Bool("only-json-tab", false, "When passed with `--json`, the tab will be written to the JSON file but not the bottle.")
bottleCmd.Flags().Bool("quiet", false, "Make some output more quiet.")
bottleCmd.Flags().Bool("root-url", false, "Use the specified <URL> as the root of the bottle's URL instead of Homebrew's default.")
bottleCmd.Flags().Bool("root-url-using", false, "Use the specified download strategy class for downloading the bottle's URL instead of Homebrew's default.")
bottleCmd.Flags().Bool("skip-relocation", false, "Do not check if the bottle can be marked as relocatable.")
bottleCmd.Flags().Bool("verbose", false, "Make some output more verbose.")
bottleCmd.Flags().Bool("write", false, "Write changes to the formula file. A new commit will be generated unless `--no-commit` is passed.")
rootCmd.AddCommand(bottleCmd)
}
31 changes: 31 additions & 0 deletions completers/brew_completer/cmd/bump.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var bumpCmd = &cobra.Command{
Use: "bump",
Short: "Display out-of-date brew formulae and the latest version available",
GroupID: "developer",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(bumpCmd).Standalone()

bumpCmd.Flags().Bool("cask", false, "Check only casks.")
bumpCmd.Flags().Bool("debug", false, "Display any debugging information.")
bumpCmd.Flags().Bool("formula", false, "Check only formulae.")
bumpCmd.Flags().Bool("full-name", false, "Print formulae/casks with fully-qualified names.")
bumpCmd.Flags().Bool("help", false, "Show this message.")
bumpCmd.Flags().Bool("installed", false, "Check formulae and casks that are currently installed.")
bumpCmd.Flags().Bool("limit", false, "Limit number of package results returned.")
bumpCmd.Flags().Bool("no-pull-requests", false, "Do not retrieve pull requests from GitHub.")
bumpCmd.Flags().Bool("open-pr", false, "Open a pull request for the new version if none have been opened yet.")
bumpCmd.Flags().Bool("quiet", false, "Make some output more quiet.")
bumpCmd.Flags().Bool("start-with", false, "Letter or word that the list of package results should alphabetically follow.")
bumpCmd.Flags().Bool("verbose", false, "Make some output more verbose.")
rootCmd.AddCommand(bumpCmd)
}
38 changes: 38 additions & 0 deletions completers/brew_completer/cmd/bumpCaskPr.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var bumpCaskPrCmd = &cobra.Command{
Use: "bump-cask-pr",
Short: "Create a pull request to update <cask> with a new version",
GroupID: "developer",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(bumpCaskPrCmd).Standalone()

bumpCaskPrCmd.Flags().Bool("commit", false, "When passed with `--write-only`, generate a new commit after writing changes to the cask file.")
bumpCaskPrCmd.Flags().Bool("debug", false, "Display any debugging information.")
bumpCaskPrCmd.Flags().Bool("dry-run", false, "Print what would be done rather than doing it.")
bumpCaskPrCmd.Flags().Bool("force", false, "Ignore duplicate open PRs.")
bumpCaskPrCmd.Flags().Bool("fork-org", false, "Use the specified GitHub organization for forking.")
bumpCaskPrCmd.Flags().Bool("help", false, "Show this message.")
bumpCaskPrCmd.Flags().Bool("message", false, "Prepend <message> to the default pull request message.")
bumpCaskPrCmd.Flags().Bool("no-audit", false, "Don't run `brew audit` before opening the PR.")
bumpCaskPrCmd.Flags().Bool("no-browse", false, "Print the pull request URL instead of opening in a browser.")
bumpCaskPrCmd.Flags().Bool("no-fork", false, "Don't try to fork the repository.")
bumpCaskPrCmd.Flags().Bool("no-style", false, "Don't run `brew style --fix` before opening the PR.")
bumpCaskPrCmd.Flags().Bool("quiet", false, "Make some output more quiet.")
bumpCaskPrCmd.Flags().Bool("sha256", false, "Specify the <SHA-256> checksum of the new download.")
bumpCaskPrCmd.Flags().Bool("url", false, "Specify the <URL> for the new download.")
bumpCaskPrCmd.Flags().Bool("verbose", false, "Make some output more verbose.")
bumpCaskPrCmd.Flags().Bool("version", false, "Specify the new <version> for the cask.")
bumpCaskPrCmd.Flags().Bool("version-arm", false, "Specify the new cask <version> for the ARM architecture.")
bumpCaskPrCmd.Flags().Bool("version-intel", false, "Specify the new cask <version> for the Intel architecture.")
bumpCaskPrCmd.Flags().Bool("write-only", false, "Make the expected file modifications without taking any Git actions.")
rootCmd.AddCommand(bumpCaskPrCmd)
}
43 changes: 43 additions & 0 deletions completers/brew_completer/cmd/bumpFormulaPr.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var bumpFormulaPrCmd = &cobra.Command{
Use: "bump-formula-pr",
Short: "Create a pull request to update <formula> with a new URL or a new tag",
GroupID: "developer",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(bumpFormulaPrCmd).Standalone()

bumpFormulaPrCmd.Flags().Bool("commit", false, "When passed with `--write-only`, generate a new commit after writing changes to the formula file.")
bumpFormulaPrCmd.Flags().Bool("debug", false, "Display any debugging information.")
bumpFormulaPrCmd.Flags().Bool("dry-run", false, "Print what would be done rather than doing it.")
bumpFormulaPrCmd.Flags().Bool("force", false, "Ignore duplicate open PRs. Remove all mirrors if `--mirror` was not specified.")
bumpFormulaPrCmd.Flags().Bool("fork-org", false, "Use the specified GitHub organization for forking.")
bumpFormulaPrCmd.Flags().Bool("help", false, "Show this message.")
bumpFormulaPrCmd.Flags().Bool("message", false, "Prepend <message> to the default pull request message.")
bumpFormulaPrCmd.Flags().Bool("mirror", false, "Use the specified <URL> as a mirror URL. If <URL> is a comma-separated list of URLs, multiple mirrors will be added.")
bumpFormulaPrCmd.Flags().Bool("no-audit", false, "Don't run `brew audit` before opening the PR.")
bumpFormulaPrCmd.Flags().Bool("no-browse", false, "Print the pull request URL instead of opening in a browser.")
bumpFormulaPrCmd.Flags().Bool("no-fork", false, "Don't try to fork the repository.")
bumpFormulaPrCmd.Flags().Bool("online", false, "Run `brew audit --online` before opening the PR.")
bumpFormulaPrCmd.Flags().Bool("python-exclude-packages", false, "Exclude these Python packages when finding resources.")
bumpFormulaPrCmd.Flags().Bool("python-extra-packages", false, "Include these additional Python packages when finding resources.")
bumpFormulaPrCmd.Flags().Bool("python-package-name", false, "Use the specified <package-name> when finding Python resources for <formula>. If no package name is specified, it will be inferred from the formula's stable URL.")
bumpFormulaPrCmd.Flags().Bool("quiet", false, "Make some output more quiet.")
bumpFormulaPrCmd.Flags().Bool("revision", false, "Specify the new commit <revision> corresponding to the specified git <tag> or specified <version>.")
bumpFormulaPrCmd.Flags().Bool("sha256", false, "Specify the <SHA-256> checksum of the new download.")
bumpFormulaPrCmd.Flags().Bool("strict", false, "Run `brew audit --strict` before opening the PR.")
bumpFormulaPrCmd.Flags().Bool("tag", false, "Specify the new git commit <tag> for the formula.")
bumpFormulaPrCmd.Flags().Bool("url", false, "Specify the <URL> for the new download. If a <URL> is specified, the <SHA-256> checksum of the new download should also be specified.")
bumpFormulaPrCmd.Flags().Bool("verbose", false, "Make some output more verbose.")
bumpFormulaPrCmd.Flags().Bool("version", false, "Use the specified <version> to override the value parsed from the URL or tag. Note that `--version=0` can be used to delete an existing version override from a formula if it has become redundant.")
bumpFormulaPrCmd.Flags().Bool("write-only", false, "Make the expected file modifications without taking any Git actions.")
rootCmd.AddCommand(bumpFormulaPrCmd)
}
27 changes: 27 additions & 0 deletions completers/brew_completer/cmd/bumpRevision.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var bumpRevisionCmd = &cobra.Command{
Use: "bump-revision",
Short: "Create a commit to increment the revision of <formula>",
GroupID: "developer",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(bumpRevisionCmd).Standalone()

bumpRevisionCmd.Flags().Bool("debug", false, "Display any debugging information.")
bumpRevisionCmd.Flags().Bool("dry-run", false, "Print what would be done rather than doing it.")
bumpRevisionCmd.Flags().Bool("help", false, "Show this message.")
bumpRevisionCmd.Flags().Bool("message", false, "Append <message> to the default commit message.")
bumpRevisionCmd.Flags().Bool("quiet", false, "Make some output more quiet.")
bumpRevisionCmd.Flags().Bool("remove-bottle-block", false, "Remove the bottle block in addition to bumping the revision.")
bumpRevisionCmd.Flags().Bool("verbose", false, "Make some output more verbose.")
bumpRevisionCmd.Flags().Bool("write-only", false, "Make the expected file modifications without taking any Git actions.")
rootCmd.AddCommand(bumpRevisionCmd)
}
26 changes: 26 additions & 0 deletions completers/brew_completer/cmd/bumpUnversionedCasks.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var bumpUnversionedCasksCmd = &cobra.Command{
Use: "bump-unversioned-casks",
Short: "Check all casks with unversioned URLs in a given <tap> for updates",
GroupID: "developer",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(bumpUnversionedCasksCmd).Standalone()

bumpUnversionedCasksCmd.Flags().Bool("debug", false, "Display any debugging information.")
bumpUnversionedCasksCmd.Flags().Bool("dry-run", false, "Do everything except caching state and opening pull requests.")
bumpUnversionedCasksCmd.Flags().Bool("help", false, "Show this message.")
bumpUnversionedCasksCmd.Flags().Bool("limit", false, "Maximum runtime in minutes.")
bumpUnversionedCasksCmd.Flags().Bool("quiet", false, "Make some output more quiet.")
bumpUnversionedCasksCmd.Flags().Bool("state-file", false, "File for caching state.")
bumpUnversionedCasksCmd.Flags().Bool("verbose", false, "Make some output more verbose.")
rootCmd.AddCommand(bumpUnversionedCasksCmd)
}
25 changes: 25 additions & 0 deletions completers/brew_completer/cmd/cat.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var catCmd = &cobra.Command{
Use: "cat",
Short: "Display the source of a <formula> or <cask>",
GroupID: "developer",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(catCmd).Standalone()

catCmd.Flags().Bool("cask", false, "Treat all named arguments as casks.")
catCmd.Flags().Bool("debug", false, "Display any debugging information.")
catCmd.Flags().Bool("formula", false, "Treat all named arguments as formulae.")
catCmd.Flags().Bool("help", false, "Show this message.")
catCmd.Flags().Bool("quiet", false, "Make some output more quiet.")
catCmd.Flags().Bool("verbose", false, "Make some output more verbose.")
rootCmd.AddCommand(catCmd)
}
Loading

0 comments on commit ed20a98

Please sign in to comment.