From d658d56eb7c00def8bbb8605c6259016979a47ba Mon Sep 17 00:00:00 2001 From: senator Date: Tue, 18 Mar 2008 14:02:27 +0000 Subject: changed command line -? to /? --- client/main.cc | 24 +++++++++++------------- 1 file 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); -- cgit v1.2.3