summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/main.cc24
1 files changed, 11 insertions, 13 deletions
diff --git a/client/main.cc b/client/main.cc
index fbedfc2..0bd94d7 100644
--- a/client/main.cc
+++ b/client/main.cc
@@ -40,17 +40,11 @@ int main(int argc, char *argv[])
char macro[100] = "example";
char cpr[11] = "0000000000";
char user[20] = "testuser";
+ char config[30] = "pracro.ini";
int a;
for(a=1; a < argc; a++) {
- /*
- if(argv[a][0] != '-') {
- strcpy(cprfile, argv[a]);
- continue;
- }
- */
- if(strcmp(argv[a], "-h") == 0 || strcmp(argv[a], "--help") == 0 ||
- strcmp(argv[a], "-?") == 0) {
+ if(strcmp(argv[a], "-h") == 0 || strcmp(argv[a], "--help") == 0) {
printf("Usage: pracro -m MACRO -c CPR -U USER\n");
printf("Executes the requested Pracro MACRO using supplied CPR "
"and USER.\n");
@@ -92,12 +86,16 @@ int main(int argc, char *argv[])
a++;
continue;
}
+ if(strcmp(argv[a], "-C") == 0 || strcmp(argv[a], "--config") == 0) {
+ if(a+1 == argc || argv[a+1][0] == '-') {
+ printf("Missing argument for config, exiting...\n");
+ exit(1);
+ }
+ strcpy(config, argv[a+1]);
+ a++;
+ continue;
+ }
}
-
-
-
-
-
new_macro(macro, cpr, user);