Check-in Number:
|
2105 | |
Date: |
2002-Apr-25 11:51:29 (local)
2002-Apr-25 09:51:29 (UTC) |
User: | ms |
Branch: | |
Comment: |
Moved early option verify from main to config. |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/rc/rc.c 1.22 -> 1.23
--- rc.c 2002/04/24 16:47:07 1.22
+++ rc.c 2002/04/25 09:51:29 1.23
@@ -70,7 +70,7 @@
configNew(); /* Construct a new configuration */
configLoad(argc, argv); /* Read configuration from cli, env, and conf */
configDebug(); /* FIXME Remove FIXME */
- rcIntro(); /* Test for usage, help, and version options */
+ configVerify(); /* Test for usage, help, and version options */
/* pRc = procNew();
procReadrc(pRc);
@@ -78,7 +78,7 @@
procReadtmp(pRc);
for (i = 0; i < clioptGetseclen; procSection(pRc, configGetsec(i)));
procParse(pRc); /- Script generation -/
- procOut(pRc); /- [Execute|Evaluate|Print] script -/
+ procRun(pRc); /- [Execute|Evaluate|Print] script -/
procDelete(pRc);*/
configDelete();
|
|
ossp-pkg/rc/rc.h 1.22 -> 1.23
--- rc.h 2002/04/24 16:47:07 1.22
+++ rc.h 2002/04/25 09:51:29 1.23
@@ -61,9 +61,6 @@
/* Rc script type */
typedef char *rc_script_t;
-/* Main function prototypes */
-rc_return_t rcIntro(void);
-
/* Option function prototypes */
/*rc_return_t optionProcess(void);
rc_return_t optionProcess(void);*/
@@ -71,6 +68,7 @@
/* Config function prototypes */
rc_return_t configNew(void);
rc_return_t configLoad(int, char **);
+rc_return_t configVerify(void);
rc_return_t configDelete(void);
const char *configSummarize(void);
void configDebug(void); /* FIXME Remove */
|
|
ossp-pkg/rc/rc_config.c 1.14 -> 1.15
--- rc_config.c 2002/04/24 16:47:07 1.14
+++ rc_config.c 2002/04/25 09:51:29 1.15
@@ -255,6 +255,29 @@
return(RC_THROW(RC_OK));
}
+/************************************************
+* configVerify(void) *
+* Verify config options help, usage, or version *
+************************************************/
+rc_return_t configVerify(void)
+{
+ ex_t Except;
+
+ ex_try { /* Basic checks of version, usage, and help options */
+ if (configGetval(RC_VER_VAL))
+ fprintf(stdout, "OSSP rc %s\n", RC_VERSION);
+ if (configGetval(RC_USE_VAL))
+ clioptPrintusage();
+ if (configGetval(RC_HLP_VAL))
+ clioptPrintusage(); /* FIXME Replace with real help FIXME */
+ }
+ ex_catch(Except) {
+ rethrow;
+ }
+
+ return(RC_THROW(RC_OK));
+}
+
/***************************************
* configDelete(void) *
* Destruct a configuration *
|
|