dev/gen/bash

MCSH bash script source generation

Dependency Graph

dev/gen/bash: Library Dependencies

View color source code (raw) for this file

View reStructuredText (rst) source code for this page

Library Configuration

$gen_bash_namespace

If set, specifies the namespace to use when generating library script functions. If not set, the basename of the generated library will be used automatically.

$gen_bash_here_pipe[]

Specifies the pipeline of commands that should be used to encode/decode the content in a here document function. The commands should be specified in the order required for encoding.

For decoding, the command pipeline is built in reverse order, and each command gets passed one additional option: -d.

MCSH Bash Script CLI

gen_bash_dispatch()

Dispatches a Bash script generation command ($@)

gen_bash_usage()

Prints usage for Bash script generation commands

gen_bash_source()

Generates Bash source file(s) for the given kind ($1), name ($2), description ($3), and (optional) dependencies ($@).

MCSH Functions

gen_bash_lib_load()

Generates a command to load a named library script ($1)

MCSH Tool Scripts

gen_bash_tool()

Generates template source code for a new tool ($1) given its description ($2) and (optional) dependencies ($@).

gen_bash_source_tool()

Generates the body of a new tool script ($1).

MCSH Tool Configuration Scripts

gen_bash_source_conf()

Generates a tool configuration file.

MCSH Library Scripts

gen_bash_lib()

Generates template source code for a new library ($1) given its description ($2) and (optional) dependencies ($@).

gen_bash_source_library()

Generates the body of a new library script ($1) with the given description ($2).

License Library

gen_bash_license()

Generates the license library from the named files.

$1 - Name of the package (e.g. $(PKG))

$2 - Name of file containing license blurb (e.g. LICENSE)

$3 - Name of file containing warranty information (e.g. WARRANTY)

$4 - Name of file containing full license (e.g. COPYING)

gen_bash_license_func()

Generates a single here document function using the given function ($1) with the given description ($2).

$1 - Name of generated license function

$2 - Description of license function (optional)

Source File Headers

gen_bash_header()

Generates a header for a Bash script.

Here Document Functions

gen_bash_here_func()

Generates a function ($1) containing a single here document ($2).

By default, the here document content gets compressed and encoded to reduce the space of the final distributable. This can be disabled by adding the following line in your configuration:

gen_bash_here_pipe=( cat )

To extract the original content, the generated function will pipe the encoded document through the same decoding and decompression programs when called. Consequently, those native dependencies must be installed on the system.

$1 - Name of function.

$2 - Function documentation string.

$3 - Name of file (optional); otherwise, document will be read from stdin.

gen_bash_here_encode_pipe()

Prints the command pipeline for encoding the content of a here document. See $gen_bash_here_pipe[].

gen_bash_here_decode_pipe()

Prints the command pipeline for decoding an encoded here document. See $gen_bash_here_pipe[].

gen_bash_here_decode_cmd()

Appends decode option to each pipeline command.

gen_bash_here_pipe()

Prints a command pipline, constructed from the given commands ($@), that can be eval-uated by the shell.

Functions

gen_bash_func()

Generates a function ($1) from the given file ($2).

$1 - Name of function.

$2 - Function documentation. If null, no documentation will be generated for the new function.

$3 - Name of file containing the function body (optional). If not given, the function body will be read from stdin.

Here Documents

gen_bash_here_doc()

Generates a here document with the given tag ($1) from the given file ($2).

$1 - Tag to use as delimiter.

$2 - Name of file containing here document content. Use - to use stdin.

$@ - Command pipeline to use for decoding content.


View the Developer Guide Index

View the Reference Manual Index


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