core/functions

Bash function support

Dependency Graph

core/functions: Library Dependencies

View color source code (raw) for this file

View reStructuredText (rst) source code for this page

Function API

is_function()

Returns success if $1 names a function

func_deprecate()

Declares the given function ($1) as an alias to another function ($2) that prints a deprecation warning.

$1 - Name of deprecated/renamed function

$2 - Name of new function to call

func_copy()

Makes a copy of named function ($1) as a new name ($2)

func_chain()

Overrides an existing function with a new body, copying the original function such that it can be called by the new function. e.g. 'func chain a b' installs 'a_b' as 'b'; 'a_b' can use 'a_b_next' to call the original 'b' (which may itself be a chained function).

func_delete()

Delets the name function ($1)

func_save()

Saves a copy of the function ($1) using a new name ($2). Currently, this is an alias for func_copy(), but that may change.

func_restore()

Restores the function ($1) using a saved copy ($2), deleting the copy when finished.

func_trace()

Prints debug string of the caller function and arguments ($@)

Boolean Function Wrappers

func_bool()

Executes arguments ($@) and prints a boolean command that produces the same result: true or false. This function

$1 - Command

$@ - Command arguments (optional)

func bool_not()

Like func_bool(), executes a command ($@), but prints a boolean command that produces the complement of its result.

$1 - Command

$@ - Command arguments (optional)


View the Developer Guide Index

View the Reference Manual Index


Generated on Fri Jul 28 14:37:11 PDT 2017 by mcsh d14 v0.23.0.