App Requirements
Require an application which composes a stand-alone single file shell application, conventionally starting with a sh-bang: #!
These are the specific requirements for the app.app
User (developer) Requirements
The application family must have an entry
subfunction returning the names of the various entry points to the application.
The application family must have a scripts
subfunction returning the names of the scripting applications used in the functions. It may return nothing.
Gather all functions
- A tool to recursively descend the entry_points function call graph, returning the names of the called functions.
- Construct a stand-alone library containing all the functions, storing in an _app suffix
- Identify and collect the various script files
- Identify and provide for download of locally installed tools. Non /bin, /usr/bin, e.g. /usr/local/bin
- Identify supported O/S, Bash Version
- Identify versions of system /bin, /usr/bin tools
- Wrap the stand-alone _app library with an entry point function call
- replace
return
codes as exit
.
Discussion
Entry Subfunction
An entry subfunction looks like this:
Executable Entry Point
A single entry point is turned into an application, in this example a file on the user's PATH named family_subfunction
Script Subfunctions
A user function finds all the files used by local tools
where script_suf converts application names to appropriate file suffix. Or returns it's argument
References
Definitions
Three definitions define sets of functions, distinguishing the need for the collection: the app, family, and library. The library is the most general, the app being the most specific. The relationship is discussed in The Standard Function Library.
Where these definitions appear in requrements documents, they assume a certain implementation, in particular the definition of a tag. Since the null-operator, a gift from the shell designers, uses the colon, it seems appropriate to use the colon as the distinguishing feature of a tag, .e.g.
date: 2020-02-20 this change ....
- app – a set of functions collected to serve a set of requirements
- canonical function – a function when formatted
declare -f function_name
- entry point – in an app, a function called only from the command line,
- family – a set of functions sharing common stem, e.g. family_subfunction
- library – a set of functions with zero or more families
- local function – a function used only within another function
- null operator – a shell command beginning with a
:
- semantic comment – a shell function which may not display its arguments, or display them on standard error
- shell script – a shell file, whose first line is a sh-bang:
#! env bash
- shdoc – a function family which implements Shell Documentation, see the Standard Function Library
- source – a builtin shell command to source or load a function library
- standard function – a function which meets the requirements of The Function Standard
- standard library – a library meeting the requirements of The Library Standard
- subfunction – a member of a function family
- tag – a colon-terminated first argument to the null command
Documents
These local papers are housed in the author's section of his commonplace book, which references The Function Standard. On your first visit here, start with README
Standards Documents
Application Requirements
Practice Documents
- Standard Function Library - A Standard Function Library adhering to the Function and Library Standards, implementing functions which support the preferred behaviors
- Tag Manual - tag semantics, defining other tags, it's open-ended.
- Function Practice, A - Applying the lessons of the Standard Function Library
External References
- Sh-bang - standard starting line of the script file