summaryrefslogtreecommitdiff
path: root/cd-tool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cd-tool.cpp')
-rw-r--r--cd-tool.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/cd-tool.cpp b/cd-tool.cpp
index ad283a4..67f1d2d 100644
--- a/cd-tool.cpp
+++ b/cd-tool.cpp
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: cd-tool.cpp,v 1.20 2003-12-11 16:53:42 pixel Exp $ */
+/* $Id: cd-tool.cpp,v 1.21 2003-12-19 21:17:07 pixel Exp $ */
#include <getopt.h>
#include <stdio.h>
@@ -55,6 +55,7 @@ struct option long_options[] = {
{"force", 0, NULL, 'f'},
{"verbose", 0, NULL, 'v'},
{"debug", 0, NULL, 'g'},
+ {"archive", 1, NULL, 'a'},
{0, 0, NULL, 0 }
};
@@ -103,7 +104,9 @@ void showhelp(void) {
" extract <file> <addr> <size> - extract some sectors to <file>\n"
" insert-file <file> <path> - insert the file to <path>\n"
" insert <file> <addr> - insert some sectors at <addr>\n"
+#if 0
" copy <isofile> - copy to another iso\n"
+#endif
" lua <luascript> - interpret single LUA script\n"
" luapatch <luapatch> <file> - create a new iso file using the LUA script\n"
" luacomp <luascript> <file> - compile a LUA script\n"
@@ -111,6 +114,7 @@ void showhelp(void) {
"Additional options:\n"
" -v for verbose mode.\n"
" -g for LUA compiling debug mode (ie, no stripping)\n"
+" -a to load an additionnal archive file\n"
" -h for this help page\n"
, argv[0]);
}
@@ -138,7 +142,7 @@ virtual int startup() throw (GeneralException) {
verbosity = M_WARNING;
- while ((c = getopt_long(argc, argv, "Hhm:p:fvg", long_options, NULL)) != EOF) {
+ while ((c = getopt_long(argc, argv, "Hhm:p:fvga:", long_options, NULL)) != EOF) {
switch (c) {
case 'h':
case 'H':
@@ -160,6 +164,9 @@ virtual int startup() throw (GeneralException) {
case 'g':
debug = true;
break;
+ case 'a':
+ new Archive(optarg);
+ break;
}
}
@@ -233,7 +240,7 @@ virtual int startup() throw (GeneralException) {
}
printm(M_STATUS, "Reading path %s to file %s.\n", arg2, arg1);
#if 0
- cdutil->read_file(file, type, dir->Sector, dir->Size);
+ cdutil->read_file(file, dir->Size, type, dir->Sector);
#else
cdfile * f = new cdfile(cdutil, dir, type);
printm(M_STATUS, f->GetName());
@@ -253,7 +260,7 @@ virtual int startup() throw (GeneralException) {
sector = atoi(argv[optind++]);
file = new Output(arg1);
printm(M_STATUS, "Reading %i bytes from sector %i to file %s.\n", size, sector, arg1);
- cdutil->read_file(file, type, sector, size);
+ cdutil->read_file(file, size, type, sector);
} else if (!strcmp(argv[optind], "insert-file")) {
cdutils::DirEntry dir, * d;
unsigned char * buffer;