mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-23 00:01:16 -03:00
implement means to learn about a functions source
This implements a way to use the `functions` command to perform introspection to learn about the characteristics of a function. Such as where it came from. Fixes #3295
This commit is contained in:
@@ -259,7 +259,7 @@ std::map<wcstring, env_var_t> function_get_inherit_vars(const wcstring &name) {
|
||||
return func ? func->inherit_vars : std::map<wcstring, env_var_t>();
|
||||
}
|
||||
|
||||
int function_get_shadow_scope(const wcstring &name) {
|
||||
bool function_get_shadow_scope(const wcstring &name) {
|
||||
scoped_lock locker(functions_lock);
|
||||
const function_info_t *func = function_get(name);
|
||||
return func ? func->shadow_scope : false;
|
||||
@@ -325,6 +325,12 @@ const wchar_t *function_get_definition_file(const wcstring &name) {
|
||||
return func ? func->definition_file : NULL;
|
||||
}
|
||||
|
||||
bool function_is_autoloaded(const wcstring &name) {
|
||||
scoped_lock locker(functions_lock);
|
||||
const function_info_t *func = function_get(name);
|
||||
return func->is_autoload;
|
||||
}
|
||||
|
||||
int function_get_definition_offset(const wcstring &name) {
|
||||
scoped_lock locker(functions_lock);
|
||||
const function_info_t *func = function_get(name);
|
||||
|
||||
Reference in New Issue
Block a user