Class: Homebrew::Cmd::Bundle::AddSubcommand Private
- Inherits:
-
AbstractSubcommand
- Object
- AbstractSubcommand
- Homebrew::Cmd::Bundle::AddSubcommand
- Defined in:
- bundle/subcommand/add.rb,
sorbet/rbi/dsl/homebrew/cmd/bundle/add_subcommand.rbi
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
Defined Under Namespace
Modules: Args
Instance Attribute Summary
Attributes inherited from AbstractSubcommand
#cleanup, #context, #quiet, #targets
Instance Method Summary collapse
- #args ⇒ T.all(Homebrew::Cmd::Bundle::Args, Homebrew::Cmd::Bundle::AddSubcommand::Args) private
- #run ⇒ void private
Methods inherited from AbstractSubcommand
args_module, command, define, define_all, #initialize, subcommand_name, subcommands_for
Methods included from Utils::Output::Mixin
#issue_reporting_message, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #opoo_without_github_actions_annotation, #pretty_cannot_install, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_install_status, #pretty_installed, #pretty_uninstalled, #pretty_unmarked, #pretty_upgradable, #pretty_warning
Constructor Details
This class inherits a constructor from Homebrew::AbstractSubcommand
Instance Method Details
#args ⇒ T.all(Homebrew::Cmd::Bundle::Args, Homebrew::Cmd::Bundle::AddSubcommand::Args)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
10 |
# File 'sorbet/rbi/dsl/homebrew/cmd/bundle/add_subcommand.rbi', line 10 def args; end |
#run ⇒ void
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
This method returns an undefined value.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'bundle/subcommand/add.rb', line 48 def run selected_types = context.selected_types(args) raise UsageError, "`add` supports only one type of entry at a time." if selected_types.count != 1 type = case (t = selected_types.first) when :none then :brew when :mas then raise UsageError, "`add` does not support `--mas`." else t end extension = Homebrew::Bundle.extension(type) if extension && !extension.add_supported? raise UsageError, "`add` does not support `--#{extension.flag}`." end Homebrew::Bundle::Adder.add( *args.named, type:, global: context.global, file: context.file, describe: !args.no_describe?, ) end |