new_function is a program that creates shell function templates.
Designed to be used in conjunction with the new_script template
generation program, this program rapidly creates shell functions in
your scripts.

This can be used as a stand alone program, but is best suited for use
with a text editor that can support its output. Instructions for
integrating new_function with the Nedit text editor appear below.

-f file Output is written to file. If omitted, output
is written to standard output. Since the
interactive prompting is also written to
standard output, the -f option is required for
file output.

After invoking new_function, the user will be prompted as follows:

Name of function:

Answer with the function's name. This must be a single word that is
an valid command name.

Description of function:

Answer with a one line description of the function's purpose.

Does this function have arguments? [y/n]:

Answer y or n. If you answer "y" then you will be prompted for the
following:

Description of argument 1:

Enter a one line description of the first argument.

Is argument 1 optional? [y/n]:

Answer y or n. If an argument is required (i.e. not optional), code will be
inserted into the function to check for its presence when the function
is called. If the function supports multiple arguments, no required
arguments are possible after the first optional argument.

You can integrate the new_function program into the Nedit text
editor. Once installed into the "Shell" menu, you can directly add
shell functions to your scripts in the edit buffer of Nedit. If you
don't yet have Nedit, you can get it at http://www.nedit.org.

To add new_function to the shell menu in Nedit, go to the
Preferences/Default Settings/Customize Menus/Shell Menu... dialog and
create a new menu entry called "new_function". Set command input to
"none" and command output to "same window". Finally, set the "shell
command to execute" to the following command line:

new_function has been tested on Redhat Linux versions 5.x, 6.x and 7.x.
new_function is a rather generic script and will probably work on all
contemporary Linux distributions equipped with the bash shell.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.