Part of bzrlib
Class | CommandInfo | Information about a command. |
Class | CommandRegistry | Special registry mapping command names to command classes. |
Function | register_command | Register a plugin command. |
Function | all_command_names | Return a set of all command names. |
Function | builtin_command_names | Return list of builtin command names. |
Function | plugin_command_names | Returns command names from commands registered by plugins. |
Function | get_cmd_object | Return the command object for a command. |
Function | probe_for_provider | Look for a provider for cmd_name. |
Class | Command | Base class for commands. |
Class | CommandHooks | Hooks related to Command object creation/enumeration. |
Function | parse_args | Parse command line. |
Function | apply_coveraged | Undocumented |
Function | apply_profiled | Undocumented |
Function | exception_to_return_code | UI level helper for profiling and coverage. |
Function | apply_lsprofiled | Undocumented |
Function | get_alias | Return an expanded alias, or None if no alias exists. |
Function | run_bzr | Execute a command. |
Function | display_command | Decorator that suppresses pipe/interrupt errors. |
Function | install_bzr_command_hooks | Install the hooks to supply bzr's own commands. |
Function | main | Main entry point of command-line interface. |
Function | run_bzr_catch_errors | Run a bzr command with parameters as described by argv. |
Function | run_bzr_catch_user_errors | Run bzr and report user errors, but let internal errors propagate. |
Class | HelpCommandIndex | A index for bzr help that returns commands. |
Class | Provider | Generic class to be overriden by plugins |
Class | ProvidersRegistry | This registry exists to allow other providers to exist |
Function | _squish_command_name | Undocumented |
Function | _unsquish_command_name | Undocumented |
Function | _register_builtin_commands | Undocumented |
Function | _scan_module_for_commands | Undocumented |
Function | _list_bzr_commands | Find commands from bzr's core and plugins. |
Function | _get_cmd_object | Get a command object. |
Function | _try_plugin_provider | Probe for a plugin provider having cmd_name. |
Function | _get_bzr_command | Get a command from bzr's core. |
Function | _get_external_command | Lookup a command that is a shell script. |
Function | _get_plugin_command | Get a command from bzr's plugins. |
Function | _match_argform | Undocumented |
Function | _specified_or_unicode_argv | Undocumented |
Should generally be avoided in favor of lazy registration.
This is not the public interface, just the default hook called by all_command_names.
Use of all_command_names() is encouraged rather than builtin_command_names and/or plugin_command_names.
Return the command object for a command.
Parameters | cmd_name | The name of the command. |
plugins_override | Allow plugins to override builtins. | |
check_missing | Look up commands not found in the regular index via the get_missing_command hook. | |
Returns | A Command object instance | |
Raises | KeyError | If no command is found. |
Parameters | cmd_name | The command name. |
Returns | plugin_metadata, provider for getting cmd_name. | |
Raises | NoPluginAvailable | When no provider can supply the plugin. |
Arguments and options are parsed at this level before being passed down to specific command handlers. This routine knows, from a lookup table, something about the available options, what optargs they take, and which commands will accept them.
This transforms exceptions into a return value of 3. As such its only relevant to the UI layer, and should never be called where catching exceptions may be desirable.
Return an expanded alias, or None if no alias exists.
Execute a command.
Special master options: these must come before the command because they control how the command is interpreted.
--no-plugins | Do not load plugin modules at all |
--no-aliases | Do not allow aliases |
--builtin | Only use builtin commands. (Plugins are still allowed to change other behaviour.) |
--profile | Run under the Python hotshot profiler. |
--lsprof | Run under the Python lsprof profiler. |
--coverage | Generate line coverage report in the specified directory. |
--concurrency | Specify the number of processes that can be run concurrently (selftest). |
Parameters | argv | The command-line arguments, without the program name from argv[0] These should already be decoded. All library/test code calling run_bzr should be passing valid strings (don't need decoding). |
load_plugins | What function to call when triggering plugin loading. This function should take no arguments and cause all plugins to be loaded. | |
disable_plugins | What function to call when disabling plugin loading. This function should take no arguments and cause all plugin loading to be prohibited (so that code paths in your application that know about some plugins possibly being present will fail to import those plugins even if they are installed.) | |
Returns | Returns a command exit code or raises an exception. |
Typically bzrlib.initialize
should be called first.
Parameters | argv | list of unicode command-line arguments similar to sys.argv. argv[0] is script name usually, it will be ignored. Don't pass here sys.argv because this list contains plain strings and not unicode; pass None instead. |
Returns | exit code of bzr command. |