From 55a26ce4cc0045116aa5d397b55d487e8118b7db Mon Sep 17 00:00:00 2001 From: Max Eisner <4730112+max-ae@users.noreply.github.com> Date: Wed, 10 Aug 2022 15:11:06 +0200 Subject: [PATCH] make `executable` and `subcmd` mandatory args --- Library/Homebrew/formula.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 44ca74df61..4a25fa042e 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1627,22 +1627,21 @@ class Formula # Generate shell completions for a formula for bash, zsh, and fish, using the formula's executable. # + # @param executable [Pathname] the executable to use for generating the completion scripts. + # @param subcmd [String] the command to pass to the `executable`. # @param base_name [String] the base name of the generated completion script. Defaults to the formula name. # @param shells [Array] the shells to generate completion scripts for. Defaults to `[:bash, :zsh, :fish]`. - # @param executable [Pathname] the executable to use for generating the completion scripts. Defaults to the - # executable with the name of the formula. - # @param subcmd [String] the command to pass to the `executable`. Defaults to 'completion'. # @param shell_parameter_format [String]/[Symbol] specify how `shells` should each be passed # to the `executable`. Takes either a String representing a prefix, or one of [:flag, :arg, :none]. # Defaults to plainly passing the shell. sig { - params(base_name: String, shells: T::Array[Symbol], executable: Pathname, subcmd: String, + params(executable: Pathname, subcmd: String, base_name: String, shells: T::Array[Symbol], shell_parameter_format: T.nilable(T.any(Symbol, String))).void } - def generate_completions_from_executable(base_name: name, + def generate_completions_from_executable(executable, + subcmd, + base_name: name, shells: [:bash, :zsh, :fish], - executable: bin/base_name, - subcmd: "completion", shell_parameter_format: nil) completion_script_path_map = { bash: bash_completion/base_name,