Subversion Repositories spk

Rev

Rev 317 | Rev 322 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 317 Rev 320
Line 1... Line 1...
1
#include <spk.h>
1
#include <spk.h>
2
#include <StringList.h>
-
 
3
 
-
 
4
Utils::WString g_dir;
-
 
5
 
-
 
6
#ifdef _WIN32
-
 
7
#include <windows.h>
-
 
8
#include <direct.h>
-
 
9
//#include <shlobj.h>
-
 
10
#else
-
 
11
#include <dirent.h> 
-
 
12
#include <sys/types.h> 
-
 
13
#include <sys/param.h> 
-
 
14
#include <sys/stat.h> 
-
 
15
#include <unistd.h> 
-
 
16
#endif
-
 
17
 
-
 
18
#include "Utils/CommandLine.h"
2
#include "Utils/CommandLine.h"
19
 
3
 
20
void PrintError ( int err )
4
void PrintError ( int err )
21
{
5
{
22
	switch ( err )
6
	switch ( err )
23
	{
7
	{
24
		case CATERR_NODATFILE:
8
		case CATERR_NODATFILE:
25
			printf ( "No dat file found\n" );
9
			printf ( "No dat file found\n" );
26
			break;
10
			break;
27
		case CATERR_NOCATFILE:
11
		case CATERR_NOCATFILE:
28
			printf ( "Unable to open cat file\n" );
12
			printf ( "Unable to open cat file\n" );
29
			break;
13
			break;
30
		case CATERR_FILEEMPTY:
14
		case CATERR_FILEEMPTY:
31
			printf ( "Cat file is empty\n" );
15
			printf ( "Cat file is empty\n" );
32
			break;
16
			break;
33
		case CATERR_READCAT:
17
		case CATERR_READCAT:
34
			printf ( "Unable to read cat file\n" );
18
			printf ( "Unable to read cat file\n" );
35
			break;
19
			break;
36
		case CATERR_DECRYPT:
20
		case CATERR_DECRYPT:
37
			printf ( "Unable to decrypt cat file\n" );
21
			printf ( "Unable to decrypt cat file\n" );
38
			break;
22
			break;
39
		case CATERR_MISMATCH:
23
		case CATERR_MISMATCH:
40
			printf("Dat file size mismatch\n");
24
			printf("Dat file size mismatch\n");
41
			break;
25
			break;
42
		case CATERR_CREATED:
26
		case CATERR_CREATED:
43
			printf("Cat file does not exist\n");
27
			printf("Cat file does not exist\n");
44
			break;
28
			break;
45
	}
29
	}
46
}
30
}
47
 
31
 
48
void ListFiles(const Utils::CommandLine &cmd)
32
void ListFiles(const Utils::CommandLine &cmd)
49
{
33
{
50
	const Utils::WString& filename = cmd.arg(1);
34
	const Utils::WString& filename = cmd.arg(1);
51
	const Utils::WString& searchmask = cmd.arg(2);
35
	const Utils::WString& searchmask = cmd.arg(2);
52
 
36
 
53
	CFileIO File(!filename.contains(L":") ? CDirIO(g_dir).file(filename) : filename);
37
	CFileIO File(!filename.contains(L":") ? CDirIO(cmd.cmdDir()).file(filename) : filename);
54
	if(!File.exists())
38
	if(!File.exists())
55
		File.open(filename);
39
		File.open(filename);
56
	if (!File.exists())
40
	if (!File.exists())
57
	{
41
	{
58
		wprintf(L"Error: Cat file: %s, does not exist", filename.c_str());
42
		wprintf(L"Error: Cat file: %s, does not exist", filename.c_str());
Line 61... Line 45...
61
	
45
	
62
	wprintf(L"Listing files in %s...", filename.c_str());
46
	wprintf(L"Listing files in %s...", filename.c_str());
63
	if (!searchmask.empty())
47
	if (!searchmask.empty())
64
		wprintf(L"(%s)", searchmask.c_str() );
48
		wprintf(L"(%s)", searchmask.c_str() );
65
	printf("\n");
49
	printf("\n");
66
 
50
 
67
	CCatFile catfile;
51
	CCatFile catfile;
68
	int err = catfile.open(File.fullFilename(), L"", CATREAD_CATDECRYPT);
52
	int err = catfile.open(File.fullFilename(), L"", CATREAD_CATDECRYPT);
69
 
53
 
70
	int listed = 0;
54
	int listed = 0;
71
	if ( err == CATERR_NONE )
55
	if ( err == CATERR_NONE )
72
	{
56
	{
73
		printf ( "Opened file\n" );
57
		printf ( "Opened file\n" );
74
		for (unsigned int i = 0; i < catfile.GetNumFiles(); i++)
58
		for (unsigned int i = 0; i < catfile.GetNumFiles(); i++)
75
		{
59
		{
76
			SInCatFile *file = catfile.GetFile ( i );
60
			SInCatFile *file = catfile.GetFile ( i );
77
 
61
 
78
			if (!searchmask.empty())
62
			if (!searchmask.empty())
79
			{
63
			{
80
				if (!file->sFile.match(searchmask))
64
				if (!file->sFile.match(searchmask))
Line 85... Line 69...
85
			++listed;
69
			++listed;
86
		}
70
		}
87
 
71
 
88
		if (!searchmask.empty())
72
		if (!searchmask.empty())
89
			wprintf(L"\nListed Files: [%d/%d]", listed, static_cast<int>(catfile.GetNumFiles()));
73
			wprintf(L"\nListed Files: [%d/%d]", listed, static_cast<int>(catfile.GetNumFiles()));
90
	}
74
	}
91
	else
75
	else
92
		PrintError ( err );
76
		PrintError ( err );
93
}
77
}
94
 
78
 
95
void findAllFiles(const CDirIO &dirIO, const Utils::WString& dir, const Utils::WString& filepattern, Utils::WStringList& list)
79
void findAllFiles(const CDirIO &dirIO, const Utils::WString& dir, const Utils::WString& filepattern, Utils::WStringList& list)
Line 101... Line 85...
101
		{
85
		{
102
			if (dirIO.isDir((*itr)->str))
86
			if (dirIO.isDir((*itr)->str))
103
				findAllFiles(dirIO, (*itr)->str, filepattern, list);
87
				findAllFiles(dirIO, (*itr)->str, filepattern, list);
104
			else
88
			else
105
				list.pushBack((*itr)->str);
89
				list.pushBack((*itr)->str);
106
		}
90
		}
107
	}
91
	}
108
}
92
}
109
 
93
 
110
bool findFiles(Utils::WStringList &files, const Utils::WString &filepattern)
94
bool findFiles(Utils::WStringList &files, const Utils::WString &filepattern, const Utils::CommandLine &cmd)
111
{
95
{
112
	CFileIO File((filepattern.contains(L":")) ? filepattern : g_dir + L"/" + filepattern);
96
	CFileIO File((filepattern.contains(L":")) ? filepattern : cmd.cmdDir() + L"/" + filepattern);
113
	return File.GetDirIO().dirList(files, Utils::WString::Null(), File.filename(), true);
97
	return File.GetDirIO().dirList(files, Utils::WString::Null(), File.filename(), true);
114
}
98
}
115
 
99
 
116
 
100
 
117
void ExtractFile (const Utils::CommandLine& cmd, const Utils::WString& fileMask, bool preserve)
101
void ExtractFile (const Utils::CommandLine& cmd, const Utils::WString& fileMask, bool preserve)
118
{
102
{
119
	Utils::WString filename = cmd.arg(1) + fileMask;
103
	Utils::WString filename = cmd.arg(1) + fileMask;
120
	Utils::WString to = cmd.argCount() < 2 ? cmd.cmdDir() : cmd.arg(2);
104
	Utils::WString to = cmd.argCount() < 2 ? cmd.cmdDir() : cmd.arg(2);
121
	if (!to.contains(L":")) to = cmd.file()->dirIO().file(to);
105
	if (!to.contains(L":")) to = cmd.file()->dirIO().file(to);
122
	CDirIO destination(to);
106
	CDirIO destination(to);
123
 
107
 
Line 125... Line 109...
125
		preserve = true;
109
		preserve = true;
126
		
110
		
127
	if ( !filename.contains(L"::") ) return;
111
	if ( !filename.contains(L"::") ) return;
128
 
112
 
129
	Utils::WString catfile = filename.token(L"::", 1);
113
	Utils::WString catfile = filename.token(L"::", 1);
130
	CFileIO File((catfile.contains(L":")) ? catfile : g_dir + L"/" + catfile);
114
	CFileIO File((catfile.contains(L":")) ? catfile : cmd.cmdDir() + L"/" + catfile);
131
	Utils::WString filemask = filename.token(L"::", 2);
115
	Utils::WString filemask = filename.token(L"::", 2);
132
 
116
 
133
	CCatFile cat;
117
	CCatFile cat;
134
	int err = cat.open(File.fullFilename(), L"", CATREAD_DAT);
118
	int err = cat.open(File.fullFilename(), L"", CATREAD_DAT);
135
	if ( err )
119
	if ( err )
136
	{
120
	{
137
		PrintError ( err );
121
		PrintError ( err );
138
		return;
122
		return;
139
	}
123
	}
140
 
124
 
141
	Utils::WStringList fileList;
125
	Utils::WStringList fileList;
142
	if (filemask.containsAny(L"*?"))
126
	if (filemask.containsAny(L"*?"))
143
	{
127
	{
Line 162... Line 146...
162
		Utils::WString file = (*itr)->str;
146
		Utils::WString file = (*itr)->str;
163
		if (!cat.extractFile(file, to, preserve))
147
		if (!cat.extractFile(file, to, preserve))
164
			wprintf(L"Error: %s\n", cat.getErrorString().c_str() );
148
			wprintf(L"Error: %s\n", cat.getErrorString().c_str() );
165
		else
149
		else
166
			wprintf(L"File has been written: %s\n", preserve ? file.c_str() : CFileIO(file).filename().c_str());
150
			wprintf(L"File has been written: %s\n", preserve ? file.c_str() : CFileIO(file).filename().c_str());
167
	}
151
	}
168
}
152
}
169
 
153
 
170
void AppendFile (const Utils::CommandLine& cmd)
154
void AppendFile (const Utils::CommandLine& cmd)
171
{
155
{
172
	Utils::WString sFile = cmd.arg(2);
156
	Utils::WString sFile = cmd.arg(2);
173
	Utils::WString filepattern = cmd.arg(1);
157
	Utils::WString filepattern = cmd.arg(1);
174
	Utils::WString catfile;
158
	Utils::WString catfile;
175
	Utils::WString file;
159
	Utils::WString file;
176
 
160
 
177
	bool recursive = cmd.hasSwitch(L"recursive");
161
	bool recursive = cmd.hasSwitch(L"recursive");
178
 
162
 
179
	Utils::WString C_File = sFile.findReplace(L"\\", L"/");
163
	Utils::WString C_File = sFile.findReplace(L"\\", L"/");
180
	bool doFile = false;
164
	bool doFile = false;
181
	if ( !C_File.contains(L"::"))
165
	if ( !C_File.contains(L"::"))
182
	{
166
	{
183
		catfile = C_File;
167
		catfile = C_File;
184
		doFile = true;
168
		doFile = true;
185
	}
169
	}
186
	else
170
	else
187
	{
171
	{
188
		catfile = C_File.token(L"::", 1);
172
		catfile = C_File.token(L"::", 1);
189
		file = C_File.token(L"::", 2);
173
		file = C_File.token(L"::", 2);
190
	}
174
	}
191
 
175
 
192
	if (!catfile.contains(":"))
176
	if (!catfile.contains(":"))
193
		catfile = g_dir + L"/" + catfile;
177
		catfile = cmd.cmdDir() + L"/" + catfile;
194
 
178
 
195
	Utils::WStringList list;
179
	Utils::WStringList list;
196
 
180
 
197
	CFileIO File((filepattern.contains(L":")) ? filepattern : g_dir + L"/" + filepattern);
181
	CFileIO File((filepattern.contains(L":")) ? filepattern : cmd.cmdDir() + L"/" + filepattern);
198
	if (recursive)
182
	if (recursive)
199
		findAllFiles(File.dirIO(), L"", File.filename(), list);
183
		findAllFiles(File.dirIO(), L"", File.filename(), list);
200
	else
184
	else
201
		findFiles(list, filepattern);
185
		findFiles(list, filepattern, cmd);
202
	if (!list.size())
186
	if (!list.size())
203
	{
187
	{
204
		wprintf(L"Error: no files found to add: %s\n", filepattern.c_str());
188
		wprintf(L"Error: no files found to add: %s\n", filepattern.c_str());
205
		return;
189
		return;
206
	}
190
	}
Line 211... Line 195...
211
	{
195
	{
212
		PrintError ( err );
196
		PrintError ( err );
213
		return;
197
		return;
214
	}
198
	}
215
 
199
 
216
 
200
 
217
	int added = 0;
201
	int added = 0;
218
	for (auto itr = list.begin(); itr != list.end(); itr++)
202
	for (auto itr = list.begin(); itr != list.end(); itr++)
219
	{
203
	{
220
		if (File.dirIO().isDir((*itr)->str))
204
		if (File.dirIO().isDir((*itr)->str))
221
			continue;
205
			continue;
222
 
206
 
223
		Utils::WString filename = (*itr)->str;
207
		Utils::WString filename = (*itr)->str;
224
		Utils::WString toFile = file;
208
		Utils::WString toFile = file;
225
		if (doFile)			
209
		if (doFile)			
226
			toFile = File.dirIO().relativePath(filename);;
210
			toFile = File.dirIO().relativePath(filename);;
227
 
211
 
228
		if (!toFile.contains(L"."))
212
		if (!toFile.contains(L"."))
229
		{
213
		{
230
			if (toFile[static_cast<unsigned long>(toFile.length() - 1)] != L'/')
214
			if (toFile[static_cast<unsigned long>(toFile.length() - 1)] != L'/')
231
				toFile += L"/";
215
				toFile += L"/";
232
			toFile += CFileIO(filename).filename();
216
			toFile += CFileIO(filename).filename();
233
		}
217
		}
234
 
218
 
235
		++added;
219
		++added;
236
		if (cat.appendFile(filename, toFile))
220
		if (cat.appendFile(filename, toFile))
237
			wprintf(L"File %s has beed added to: %s::%s\n", filename.c_str(), catfile.c_str(), toFile.c_str());
221
			wprintf(L"File %s has beed added to: %s::%s\n", filename.c_str(), catfile.c_str(), toFile.c_str());
238
		else
222
		else
239
			wprintf(L"Error: Unable to add file: %s\n", filename.c_str());
223
			wprintf(L"Error: Unable to add file: %s\n", filename.c_str());
240
	}
224
	}
241
 
225
 
242
	if(!added)
226
	if(!added)
243
		wprintf(L"Warning: Nothing to add: %s\n", filepattern.c_str());
227
		wprintf(L"Warning: Nothing to add: %s\n", filepattern.c_str());
244
}
228
}
245
 
229
 
246
void RemoveFile (const Utils::WString &C_File, const Utils::WString &remfile )
230
void RemoveFile (const Utils::CommandLine &cmd)
247
{
231
{
-
 
232
	Utils::WString C_File = cmd.arg(1);
-
 
233
	Utils::WString remfile = cmd.arg(2);
-
 
234
 
-
 
235
	CFileIO File((C_File.contains(L":")) ? C_File : cmd.cmdDir() + L"/" + C_File);
248
	// first open the cat file
236
	// first open the cat file
249
	CCatFile cat;
237
	CCatFile cat;
250
	int err = cat.open(C_File, L"", CATREAD_CATDECRYPT);
238
	int err = cat.open(File.fullFilename(), L"", CATREAD_CATDECRYPT);
251
	if ( err )
239
	if ( err )
252
	{
240
	{
253
		PrintError ( err );
241
		PrintError ( err );
254
		return;
242
		return;
255
	}
243
	}
256
 
244
 
-
 
245
	std::vector<Utils::WString> files;
-
 
246
	if (remfile.containsAny(L"*?"))
-
 
247
	{
-
 
248
		for (unsigned int i = 0; i < cat.GetNumFiles(); i++)
-
 
249
		{
257
	SInCatFile *f = cat.findData(remfile);
250
			SInCatFile* f = cat.GetFile(i);
-
 
251
			if (f->sFile.match(remfile))
-
 
252
				files.push_back(f->sFile);
-
 
253
		}
-
 
254
	}
258
	if ( !f )
255
	else
-
 
256
		files.push_back(remfile);
-
 
257
 
-
 
258
	for (auto itr = files.begin(); itr != files.end(); itr++)
259
	{
259
	{
-
 
260
		if (!cat.removeFile(*itr))
260
		wprintf(L"Unable to find %s in cat file\n", remfile.c_str() );
261
			wprintf(L"Unable to find %s in cat file\n", itr->c_str());
261
		return;
262
		else
-
 
263
			wprintf(L"%s: has been removed from archive\n", itr->c_str());
262
	}
264
	}
263
 
-
 
264
	if (cat.removeFile(f))
-
 
265
		printf ( "File has been removed from archive\n" );
-
 
266
}
265
}
267
 
266
 
268
void UnpackFile(const Utils::WString &file, const Utils::WString &tofile, const Utils::WString &ext)
267
void UnpackFile(const Utils::CommandLine &cmd)
269
{
268
{
-
 
269
	const Utils::WString& file = cmd.arg(1);
-
 
270
	const Utils::WString & tofile = cmd.arg(2);
-
 
271
	const Utils::WString& ext = cmd.switchData(L"ext");
-
 
272
 
270
	Utils::WStringList list;
273
	Utils::WStringList list;
271
	if(!findFiles(list, file) || !list.size())
274
	if(!findFiles(list, file, cmd) || !list.size())
272
	{
275
	{
273
		wprintf(L"Error: no files found to unpack: %s\n", file.c_str());
276
		wprintf(L"Error: no files found to unpack: %s\n", file.c_str());
274
		return;
277
		return;
275
	}
278
	}
276
 
279
 
277
	for(auto itr = list.first(); itr; itr = list.next())
280
	for(auto itr = list.first(); itr; itr = list.next())
278
	{
281
	{
279
		Utils::WString filename = itr->str;
282
		Utils::WString filename = itr->str;
280
 
283
 
281
		C_File f(filename);
284
		C_File f(filename);
282
		if (!f.CheckValidFilePointer())
285
		if (!f.CheckValidFilePointer())
283
		{
286
		{
284
			CFileIO File((file.contains(L":")) ? file : g_dir + L"/" + file);
287
			CFileIO File((file.contains(L":")) ? file : cmd.cmdDir() + L"/" + file);
285
			filename = File.GetDirIO().file(itr->str);
288
			filename = File.GetDirIO().file(itr->str);
286
			f.setFilename(filename);
289
			f.setFilename(filename);
287
		}
290
		}
288
 
291
 
289
		Utils::WString oldFilename = f.filename();
292
		Utils::WString oldFilename = f.filename();
290
 
293
 
291
		if ( !f.CheckValidFilePointer() )
294
		if ( !f.CheckValidFilePointer() )
292
			wprintf(L"Error: %s doesn't exists\n", filename.c_str() );
295
			wprintf(L"Error: %s doesn't exists\n", filename.c_str() );
Line 312... Line 315...
312
			}
315
			}
313
		}
316
		}
314
	}
317
	}
315
}
318
}
316
 
319
 
317
void PackFile(const Utils::WString &file, const Utils::WString &tofile)
320
void PackFile(const Utils::CommandLine &cmd)
318
{
321
{
-
 
322
	const Utils::WString& file = cmd.arg(1);
-
 
323
	const Utils::WString& tofile = cmd.arg(2);
-
 
324
 
319
	Utils::WStringList list;
325
	Utils::WStringList list;
320
	if(!findFiles(list, file) || !list.size())
326
	if(!findFiles(list, file, cmd) || !list.size())
321
	{
327
	{
322
		wprintf(L"Error: no files found to pack: %s\n", file.c_str());
328
		wprintf(L"Error: no files found to pack: %s\n", file.c_str());
323
		return;
329
		return;
324
	}
330
	}
325
 
331
 
Line 351... Line 357...
351
				f.setFilename(tofile);
357
				f.setFilename(tofile);
352
 
358
 
353
			if ( !f.writeFilePointer() )
359
			if ( !f.writeFilePointer() )
354
				wprintf(L"Error: unable to write file: %s\n", tofile.c_str() );
360
				wprintf(L"Error: unable to write file: %s\n", tofile.c_str() );
355
			else
361
			else
356
				wprintf(L"%s has been packed to %s\n", file.c_str(), f.filename().c_str() );
362
				wprintf(L"%s has been packed to %s\n", CFileIO(filename).filename().c_str(), f.filename().c_str());
357
		}
363
		}
358
	}
364
	}
359
}
365
}
360
 
366
 
361
void PrintSyntax(const Utils::WString &cmd)
367
void PrintSyntax(const Utils::WString &cmd)
Line 382... Line 388...
382
{
388
{
383
	printf ( "\nCATPCK Tool V1.22 17/05/2025 (SPK: %.2f) Created by Cycrow\n\n", GetLibraryVersion() );
389
	printf ( "\nCATPCK Tool V1.22 17/05/2025 (SPK: %.2f) Created by Cycrow\n\n", GetLibraryVersion() );
384
 
390
 
385
	// parse the cmd name
391
	// parse the cmd name
386
	Utils::CommandLine cmd(argc, argv);
392
	Utils::CommandLine cmd(argc, argv);
387
	g_dir = cmd.cmdDir();
-
 
388
 
393
 
389
	if ( argc < 2 )
394
	if ( argc < 2 )
390
		PrintSyntax(cmd.cmdName());
395
		PrintSyntax(cmd.cmdName());
391
	else
396
	else
392
	{
397
	{
Line 415... Line 420...
415
			else
420
			else
416
				ExtractFile(cmd, L"::*", true);
421
				ExtractFile(cmd, L"::*", true);
417
		}
422
		}
418
		else if ( (command == L"-a") || (command == L"-append") )
423
		else if ( (command == L"-a") || (command == L"-append") )
419
		{
424
		{
420
			if (args.size() < 3 )
425
			if (cmd.argCount() < 3 )
421
				wprintf(L"Syntax: %s -a <filename> <catfile::tofile>\n\tAppends a file into the archive\n", cmd.cmdName().c_str() );
426
				wprintf(L"Syntax: %s -a <filename> <catfile::tofile>\n\tAppends a file into the archive\n", cmd.cmdName().c_str() );
422
			else
427
			else
423
				AppendFile(cmd);
428
				AppendFile(cmd);
424
		}
429
		}
425
		else if ( (command == L"-r") || (command == L"-remove") )
430
		else if ( (command == L"-r") || (command == L"-remove") )
426
		{
431
		{
427
			if ( args.size() < 3 )
432
			if (cmd.argCount() < 3 )
428
				wprintf(L"Syntax: %s -r <catfile> <filename>\n\tRemoves a file from the archive\n", cmd.cmdName().c_str() );
433
				wprintf(L"Syntax: %s -r <catfile> <filename>\n\tRemoves a file from the archive\n", cmd.cmdName().c_str() );
429
			else
434
			else
430
				RemoveFile (args[1], args[2]);
435
				RemoveFile(cmd);
431
		}
436
		}
432
		else if ( (command == L"-u") || (command == L"-unpack") )
437
		else if ( (command == L"-u") || (command == L"-unpack") )
433
		{
438
		{
434
			Utils::WString ext = cmd.switchData(L"--ext");
-
 
435
 
-
 
436
			if ( args.size() < 2 )
439
			if (cmd.argCount() < 2 )
437
				wprintf(L"Syntax: %s [--ext:EXTENSION] -u <filename> [to]\n\tUnpacks a file", cmd.cmdName().c_str() );
440
				wprintf(L"Syntax: %s [--ext:EXTENSION] -u <filename> [to]\n\tUnpacks a file", cmd.cmdName().c_str() );
438
			else if ( args.size() < 3)
-
 
439
				UnpackFile(args[1], L"", ext);
-
 
440
			else
441
			else
441
				UnpackFile(args[1], args[2], ext);
442
				UnpackFile(cmd);
442
		}
443
		}
443
		else if ( (command == L"-p") || (command == L"-pack") )
444
		else if ( (command == L"-p") || (command == L"-pack") )
444
		{
445
		{
445
			if ( args.size() < 2 )
446
			if (cmd.argCount() < 2 )
446
				wprintf(L"Syntax: %s -p <filename> [to]\n\tPacks a file to .pck", cmd.cmdName().c_str() );
447
				wprintf(L"Syntax: %s -p <filename> [to]\n\tPacks a file to .pck", cmd.cmdName().c_str() );
447
			else if ( args.size() < 3)
-
 
448
				PackFile(args[1], L"");
-
 
449
			else
448
			else
450
				PackFile(args[1], args[2]);
449
				PackFile(cmd);
451
		}
450
		}
452
		else
451
		else
453
		{
452
		{
454
			wprintf(L"Invalaid flag: %s\n\n", command.c_str());
453
			wprintf(L"Invalaid flag: %s\n\n", command.c_str());
455
			PrintSyntax(cmd.cmdName());
454
			PrintSyntax(cmd.cmdName());