Next: , Previous: , Up: actions   [Contents][Index]


8.2 Declaring actions and action sets

The structure of the action sets tree is stored in global variables defined by default; we should never try to access such variables directly.

Function: mbfl_declare_action_set action-set

Declare a new action set. action-set must be a string satisfying mbfl_string_is_name() and representing the identifier of the action set. It is an error to declare the same action set twice.

Function: mbfl_declare_action action-set keyword subset identifier description

Declare a new action belonging to an action set. The arguments are:

action-set

A string representing the name of the action set this action belongs to. The action set must have been previously declared with a call to mbfl_declare_action_set().

keyword

A unique string (in this script) satisfying mbfl_string_is_name() and identifying this action. The “main”, “before parsing options” and “after parsing options” function names associated to this action are built as:

script_action_$keyword
script_before_parsing_options_$keyword
script_after_parsing_options_$keyword
subset

If subset is the string NONE it means that this action is a leaf and it implements a script action; else subset must be the identifier of an action set subordinate to action-set: this function is recursively called to process it. The subordinate action set must have been previously declared with a call to mbfl_declare_action_set().

identifier

A string satisfying mbfl_string_is_identifier() and representing the argument on the command line used to select this action. This string must be unique for this action-set.

description

A string describing this action, to be used to compose the help screen.


Next: , Previous: , Up: actions   [Contents][Index]

This document describes version 3.0.0-devel.0 of Marcos Bash Functions Library.