make executable and subcmd mandatory args
This commit is contained in:
parent
e448601964
commit
55a26ce4cc
@ -1627,22 +1627,21 @@ class Formula
|
|||||||
|
|
||||||
# Generate shell completions for a formula for bash, zsh, and fish, using the formula's executable.
|
# 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 base_name [String] the base name of the generated completion script. Defaults to the formula name.
|
||||||
# @param shells [Array<Symbol>] the shells to generate completion scripts for. Defaults to `[:bash, :zsh, :fish]`.
|
# @param shells [Array<Symbol>] 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
|
# @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].
|
# to the `executable`. Takes either a String representing a prefix, or one of [:flag, :arg, :none].
|
||||||
# Defaults to plainly passing the shell.
|
# Defaults to plainly passing the shell.
|
||||||
sig {
|
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
|
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],
|
shells: [:bash, :zsh, :fish],
|
||||||
executable: bin/base_name,
|
|
||||||
subcmd: "completion",
|
|
||||||
shell_parameter_format: nil)
|
shell_parameter_format: nil)
|
||||||
completion_script_path_map = {
|
completion_script_path_map = {
|
||||||
bash: bash_completion/base_name,
|
bash: bash_completion/base_name,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user