Copyright © Copyright (c) WhatsApp Inc. and its affiliates. All rights reserved.
Version: 1.1.7
Authors: Maxim Fedorov.
power_shell can be used as an application, and in form of a library. When started as application, power_shell examines shell_integration configuration parameter. It can be set to shell_default, or user_default. Depending on the parameter, power_shell can load itself as user_default module (if none was loaded before), or add proxy calls to already loaded user_default module.
power_shell:eval(Mod, Fun, [Arg1, Arg2, Arg3]).
in the shell to evaluate function Fun in module Mod. It does not need to be exported. If module Mod is currently loaded, power_shell will try to locate corresponding *.beam file, load debug info chunk and evaluate function Fun with supplied arguments. If module is not loaded, but *.beam file can be found, power_shell does not attempt to load it. However, if there is a remote (fully qualified) call, Erlang VM (BEAM) will load the file automatically.
When shell integration (injection) is enabled, evaluating non-exported functions is simplified to justeval(Mod, Fun, [Args].
Available with shell integration.
Modules that were patched by 'cover' application are also supported. If a module was cover_compiled, and it is being evaluated with power_shell:eval, coverage analysis works as expected.
To preserve compatibility with earlier versions, power_shell does not execute -on_load() by default. To change
this behaviour, set skip_on_load
application variable to false
:
ok = application:load(power_shell),
ok = application:set_env(power_shell, skip_on_load, false).
During application startup, power_shell examines following application environment variables:
power_shell:eval(Mod, Fun, Args)
available in shell, via eval(Mod, Fun, Args)
-on_load()
execution when decompiling beam (or loading source)
It is possible to supply values using sys.config file, or via command line when starting BEAM:
erl -power_shell cache_code true
Generated by EDoc