2 * Copyright 1995, 1996 Perforce Software. All rights reserved.
4 * This file is part of Perforce - the FAST SCM System.
13 OPT_ONE
= 0x01, // exactly one
14 OPT_TWO
= 0x02, // exactly two
15 OPT_THREE
= 0x04, // exactly three
16 OPT_MORE
= 0x08, // more than two
17 OPT_NONE
= 0x10, // require none
18 OPT_MAKEONE
= 0x20, // if none, make one that points to null
20 // combos of the above
22 OPT_OPT
= 0x11, // NONE, or ONE
23 OPT_ANY
= 0x1F, // ONE, TWO, THREE, MORE, or NONE
24 OPT_DEFAULT
= 0x2F, // ONE, TWO, THREE, MORE, or MAKEONE
25 OPT_SOME
= 0x0F // ONE, TWO, THREE, or MORE
31 Options() { optc
= 0; }
33 void Parse( int &argc
, char **&argv
, const char *opts
,
34 int flag
, const ErrorId
&usage
, Error
*e
);
36 void Parse( int &argc
, StrPtr
*&argv
, const char *opts
,
37 int flag
, const ErrorId
&usage
, Error
*e
);
39 StrPtr
* GetValue( char opt
, int subopt
);
41 StrPtr
* operator [](char opt
) { return GetValue( opt
, 0 ); }
47 StrRef vals
[ N_OPTS
];