add configargs

This commit is contained in:
David Rose 2002-06-14 16:02:53 +00:00
parent 3bb494bbf0
commit 877d8ed142
3 changed files with 24 additions and 2 deletions

View File

@ -48,6 +48,10 @@ INLINE void ConfigTable::ConfigSuffixDefault(void) {
configsuffix = "";
}
INLINE void ConfigTable::ConfigArgsDefault(void) {
configargs = "";
}
INLINE void ConfigTable::ConfigPathDefault(void) {
configpath = "CFG_PATH";
}

View File

@ -180,8 +180,7 @@ void ConfigTable::ReadConfigFile(void) {
microconfig_cat->spam() << "examining file '" << config_file << "'"
<< endl;
if (config_file.is_executable()) {
ConfigString line = config_file.to_os_specific() + " "
+ ExecutionEnvironment::get_binary_name();
ConfigString line = config_file.to_os_specific() + " " + configargs;
if (microconfig_cat->is_spam())
microconfig_cat->spam() << "file is executable, running '"
<< line << "'" << endl;
@ -342,6 +341,7 @@ void ConfigTable::MicroConfig(void)
bool fsep = false;
bool cname = false;
bool csuff = false;
bool cargs = false;
bool cpath = false;
bool ccmt = false;
bool asuff = false;
@ -414,6 +414,15 @@ void ConfigTable::MicroConfig(void)
<< "setting the config file suffix to '"
<< configsuffix << "'"
<< endl;
} else if (tok == "configargs") {
configargs = rest;
cargs = true;
if (microconfig_cat->is_spam())
microconfig_cat->spam()
<< "got a microconfig configargs directive, "
<< "setting the config file args to '"
<< configargs << "'"
<< endl;
} else if (tok == "configpath") {
if (cpath) {
configpath += " " + rest;
@ -526,6 +535,13 @@ void ConfigTable::MicroConfig(void)
<< "setting to default '" << configsuffix
<< "'" << endl;
}
if (!cargs) {
ConfigArgsDefault();
if (microconfig_cat->is_spam())
microconfig_cat->spam() << "no microconfig for configargs, "
<< "setting to default '" << configargs
<< "'" << endl;
}
if (!cpath) {
ConfigPathDefault();
if (microconfig_cat->is_spam())

View File

@ -49,6 +49,7 @@ class EXPCL_DTOOLCONFIG ConfigTable {
ConfigString filesep;
ConfigString configname;
ConfigString configsuffix;
ConfigString configargs;
ConfigString configpath;
ConfigString configcmt;
ConfigString argsuffix;
@ -70,6 +71,7 @@ class EXPCL_DTOOLCONFIG ConfigTable {
INLINE void FileSepDefault(void);
INLINE void ConfigNameDefault(void);
INLINE void ConfigSuffixDefault(void);
INLINE void ConfigArgsDefault(void);
INLINE void ConfigPathDefault(void);
INLINE void ConfigCmtDefault(void);
INLINE void ArgSuffixDefault(void);