OSF DCE Administration Guide--Core Components

OSF DCE Administration Guide—Core Components
An argument table at the beginning of the script defines operations as separate
procedures within the script. An argument table can also define available options. A
parseargs procedure is called to parse the arguments and options passed to the script
when it is invoked.
Help information for each operation is placed in the argument tables in the script.
Other script users can get this information by using standard dcecp help operations.
Extensive error control is included because you cannnot predict or control the
conditions in which the script executes.
The rest of this section shows the general structures and conventions used in a formal
task object. To aid our explanation, we use the dcecp user task object supplied with the
DCE control program.
3.2.1 AModel for Task Objects
This section examines the parts of the user task object that should be emulated in other
task objects that you create for use with the DCE control program. Adhering to the basic
model ensures that your task object will look and behave consistently with other parts of
dcecp.
For efficiency and readability, the example does not include all of the procedures
contained in the user task object. Furthermore, we have omitted some repetitive parts of
the included procedures, replacing the omitted parts with vertical ellipses in the code
examples. The entire user task object is contained in dcelocal/dcecp.
Name your object after the entity on which it operates rather than as a verb such as
"show" or "modify." DCE control program objects are named for the DCE entity on
which they operate. Primitive objects like rpcentry and principal objects operate on
single manageable DCE entities. Task objects operate at a higher level, generally
invoking several primitive objects to achieve their goal. The authors of the user task
object contrived a higher-level entity—a user—as a manageable object.
The user object begins with the top level proc command and its argument table that
defines the procedures and operations provided by the user object. Use this syntax to
define separate procedures in this argument table:
verb command function_call procedure_name "helptext_string"
The call to the parseargs procedure (defined in a separate file called parseargs.dcp)
returns the name of the internal procedure that is to be called along with its arguments.
The parseargs procedure is explained in Section 3.2.2.
# proc user - This procedure is the front end for the user task
# scripts. All argument checking for the provided switches is done
# in the individual functions.
#
proc user { args } {
set arg_table {
3 4 Tandem Computers Incorporated 124243