Browse Prior Art Database

Hierarchical Method for Retrieving Program Option Values

IP.com Disclosure Number: IPCOM000109547D
Original Publication Date: 1992-Sep-01
Included in the Prior Art Database: 2005-Mar-24
Document File: 3 page(s) / 161K

Publishing Venue

IBM

Related People

Curry, S: AUTHOR [+3]

Abstract

Disclosed is a hierarchical method for retrieving flags and resolving flag conflicts when history files are specified. These conflicts may occur when a program allows options to be specified a number of ways. Depending on their values, options may contradict each other, especially as they attempt to override default or previously saved environment variables.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 45% of the total text.

Hierarchical Method for Retrieving Program Option Values

       Disclosed is a hierarchical method for retrieving flags
and resolving flag conflicts when history files are specified.  These
conflicts may occur when a program allows options to be specified a
number of ways.  Depending on their values, options may contradict
each other, especially as they attempt to override default or
previously saved environment variables.

      Programs allow users to set options to control everything from
whether to compile without creating an executable file to logging
commands to a history file.  In AIX*, a program can search for its
option values in basically four different ways.  If the program
allows this type of flexibility, it should search for option values
with the following hierarchy:
                Program Default
       (hardcoded in the program itself)
                       v
              The Program Profile
      (such as in $HOME/.program_profile)
                       v
         System Environment Variables
            (like SET COMMIT=YES)
                       v
          Program Command Line Flags

      The scope of each level is different.  The program's default
option values would cover all executions (multiple instances) of the
program. The next level would be the profile values.  They cover all
the working sessions that a user could have on a system.  Since users
can have multiple sessions, they can customize each session with the
session's environment variables.  Lastly, users can override all
previous command values by specifying command line flag options.
Thus, the hierarchy levels can be seen as concentric circles with the
program command line flags resting at the center.

      An example of a program default would be a structure containing
all the default option values.  If the user does not specify anything
in the hierarchy, whether the same or overriding values, these values
would be used.  However, the user could change these values in the
next level up, the program's profile.  A sample profile file would be
as follows:
COMMIT    = ON
DISPLAY   = ON
INPUTFILE = /USR/INNAME

      Thus, if the program default for displaying data was OFF the
user could override it by setting DISPLAY = ON.  This change would
take place every time the user was logged on and ran this program.
The same is true of the environment variables.  They can override
values for both the default and profile options in a user's session.

      Command line flags are the "final words" on option values.
They are specific to the command and as such, are temporary.  They
are forgotten after the command is executed.  In this example, as
with most programs that use command line flags, if a flag is
specified, it means that the option is ON.  There are no OFF
equivalents.  This has...