git » fp-git.git » commit 608a270

changed some input parameter chars in the interface

author ecalot
2005-03-26 12:51:36 UTC
committer ecalot
2005-03-26 12:51:36 UTC
parent 5fd6b61b4aab46c4ea0d202c5bfc1091dc06441f

changed some input parameter chars in the interface

PR/src/console/main.c +2 -2
PR/src/include/common.h +5 -3
PR/src/include/en.lang.pr.h +5 -5
PR/src/lib/pr.c +5 -7

diff --git a/PR/src/console/main.c b/PR/src/console/main.c
index f12b4d7..16ef496 100644
--- a/PR/src/console/main.c
+++ b/PR/src/console/main.c
@@ -79,7 +79,7 @@ int main (int argc, char **argv) {
 
 		c = getopt_long(argc,argv,PARSING_CHARS,long_options,&junk);
 		switch (c) {
-				case 'c':
+				case 'm':
 				case 'i':
 					if (hasFlag(classify_flag|export_flag)) setFlag(help_flag);
 					setFlag(import_flag);
@@ -87,7 +87,7 @@ int main (int argc, char **argv) {
 					break;
 				case 'g':
 					setFlag(cgi_flag); /* if cgi, a classify must be performed */
-				case 'd':
+				case 'c':
 					if (hasFlag(import_flag|export_flag)) setFlag(help_flag);
 					setFlag(classify_flag);
 					break;
diff --git a/PR/src/include/common.h b/PR/src/include/common.h
index 53f9555..a79d2bf 100644
--- a/PR/src/include/common.h
+++ b/PR/src/include/common.h
@@ -127,13 +127,15 @@ common.h: Princed Resources : Defines and prototypes common to all PR code
 #ifndef PR_IGNORE_RAW_OPTION
 #define PARSING_OPTRAW ,{"raw",         no_argument,       0,'r'},
 #define PARSING_CHRRAW "r"
+#define PARSING_SHOWRAW(a) a
 #else
 #define PARSING_OPTRAW ,
 #define PARSING_CHRRAW ""
+#define PARSING_SHOWRAW(a) "" 
 #endif
 #define PARSING_OPTIONS {\
-{"import",      optional_argument, 0,'c'},\
-{"classify",    no_argument,       0,'d'},\
+{"import",      optional_argument, 0,'m'},\
+{"classify",    no_argument,       0,'c'},\
 {"export",      optional_argument, 0,'x'},\
 \
 {"setauthor",   required_argument, 0,'a'},\
@@ -152,7 +154,7 @@ PARSING_OPTRAW\
 {0, 0, 0, 0}\
 }
 
-#define PARSING_CHARS    "z::i::c::dx::e::b::a::fgs::t::Rvh?"PARSING_CHRRAW
+#define PARSING_CHARS    "z::i::m::cx::e::b::a::fgs::t::Rvh?"PARSING_CHRRAW
 
 /* Flags */
 #define import_flag      0x0001
diff --git a/PR/src/include/en.lang.pr.h b/PR/src/include/en.lang.pr.h
index 92a3d64..7fca0e2 100644
--- a/PR/src/include/en.lang.pr.h
+++ b/PR/src/include/en.lang.pr.h
@@ -118,16 +118,16 @@ NULL,NULL,NULL,\
 #define PARSING_RAW ""
 #endif
 #define PARSING_HELP_BEGIN "Usage: \n\
-  pr [OPTIONS] [-x[EXPORTDIR]|-i[IMPORTDIR]|-d] [DATFILEPATH]...\n\
+  pr [OPTIONS] [-x[EXPORTDIR]|-m[IMPORTDIR]|-c] [DATFILEPATH[@resource1[,resource2...]]]...\n\
   pr --help\n\
   pr --version\n\
 \n\
   Mandatory arguments to long options are mandatory for short options too.\n\
 \n"
 #define PARSING_HELP_PART1 "\
-   -i, -c, --import[=DIRNAME] imports from DIRNAME into given dat file\n\
-   -d, --classify             returns the dat file type\n\
-   -x, -e, --export[=DIRNAME] exports given dat file into DIRNAME\n\
+   -i, -m, --import[=DIRNAME] imports from DIRNAME into given dat file\n\
+   -c, --classify             returns the dat file type\n\
+   -e, -x, --export[=DIRNAME] exports given dat file into DIRNAME\n\
 \n"
 #define PARSING_HELP_PART2 "\
    -a, --setauthor=NAME       sets your name in extracted plv files\n\
@@ -136,7 +136,7 @@ NULL,NULL,NULL,\
    -g, --cgi                  run as CGI and output mime headers\n\
    -h, -?, --help             display this help and exit\n\
    -s, --resource=RESFILE     uses an user-specific resource xml file\n\
-"PARSING_RAW
+"PARSING_SHOWRAW(PARSING_RAW)
 
 #define PARSING_HELP_PART3 "\
    -R, --recursive            searches for all dat files (only if DATFILEPATH\n\
diff --git a/PR/src/lib/pr.c b/PR/src/lib/pr.c
index 19c680e..8dd9501 100644
--- a/PR/src/lib/pr.c
+++ b/PR/src/lib/pr.c
@@ -82,9 +82,7 @@ int prExportDat(const char* vDatFile, const char* vDirName, const char* vResFile
 int prExportDatOpt(const char* vDatFile, const char* vDirName, const char* vResFile,int opt,const char* vDatFileName,const char* datAuthor, const char* backupExtension) {
 	/*
 		Arguments:
-			char* vDatFile        - full Path to the dat file;
-			                        if file use it, if directory, perform it for
-			                        all files
+			char* vDatFile        - full Path to the dat file
 			char* vDirName        - full Path to the extracting folder
 			                        (doesn't need to exist)
 			char* vResFile        - full Path to the resources XML file
@@ -128,14 +126,14 @@ int prExportDatOpt(const char* vDatFile, const char* vDirName, const char* vResF
 	char* currentDatFileName;
 	char* currentDatFile;
 
-	currentDatFile=strallocandcopy(vDatFileName);
+	currentDatFile=strallocandcopy(vDatFile);
 
 	parseGivenPath(currentDatFile);
 
 	if (vDatFileName==NULL) { /* if no special dat file was specified, a path parsed will be used */
-		aux=getFileNameFromPath(vDatFile);
+		aux=getFileNameFromPath(currentDatFile);
 	} else {
-		aux=currentDatFile;
+		aux=vDatFileName;
 	}
 	currentDatFileName=strallocandcopy(aux);
 
@@ -146,7 +144,7 @@ int prExportDatOpt(const char* vDatFile, const char* vDirName, const char* vResF
 		a-=3;
 	} else {
 		/* exporting errors/no errors */
-		a=extract(vDatFile,vDirName,r,opt,currentDatFileName,datAuthor,backupExtension);
+		a=extract(currentDatFile,vDirName,r,opt,currentDatFileName,datAuthor,backupExtension);
 	}
 	free(currentDatFileName);
 	free(currentDatFile);