Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / dtsearchpath / dtappg / Options.C
1 /* $XConsortium: Options.C /main/2 1995/07/17 13:54:17 drk $ */
2 /*******************************************************************
3 **  (c) Copyright Hewlett-Packard Company, 1990, 1991, 1992, 1993.
4 **  All rights are reserved.  Copying or other reproduction of this
5 **  program except for archival purposes is prohibited without prior
6 **  written consent of Hewlett-Packard Company.
7 ********************************************************************
8 ****************************<+>*************************************/
9
10 #include "Options.h"
11 #include <stdlib.h>
12 #include <iostream.h>
13 #include <stdio.h>
14 #include <pwd.h>
15
16 /**************************************************************
17  *
18  * Two options are available for dtappgather:
19  *
20  *      -v      Verbose    - prints the Search Path environment
21  *                           variables to standard output.
22  *      -r      Retain     - Retain previous contents of the 
23  *                           Application Manager
24  *
25  **************************************************************/
26
27 Options::Options
28         (
29         unsigned int argc,
30         char **      argv
31         ) : flags(0)
32 {
33 CString Usage ("Usage: dtappgather [ -v | -r ]");
34
35     if (argc > 1) {
36         for (int i = 1; i < argc; i++) {
37             if (strcmp(argv[i],"-v") == 0)
38                 flags += 1;
39             else if (strcmp(argv[i],"-r") == 0)
40                 flags += 2;
41             else {
42                 fprintf(stderr,"%s\n",Usage.data());
43                 exit (1);
44             }
45         }
46     }
47 }
48