Subversion Repositories spk

Rev

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

Rev 276 Rev 298
Line 289... Line 289...
289
				wprintf(L"%s has been packed to %s\n", file.c_str(), f.filename().c_str() );
289
				wprintf(L"%s has been packed to %s\n", file.c_str(), f.filename().c_str() );
290
		}
290
		}
291
	}
291
	}
292
}
292
}
293
 
293
 
294
void PrintSyntax(CyString cmd)
294
void PrintSyntax(const Utils::WString &cmd)
295
{
295
{
296
	printf ( "Syntax: %s <flags> [arguments]\n", cmd.c_str() );
296
	wprintf(L"Syntax: %s <flags> [arguments]\n", cmd.c_str() );
297
	printf ( "Flags:\n");
297
	wprintf(L"Flags:\n");
298
	printf ( "\t-l <filename> [filemask]\n");
298
	wprintf(L"\t-l <filename> [filemask]\n");
299
	printf ( "\t\tLists the contents of a cat file, with optional search mask\n");
299
	wprintf(L"\t\tLists the contents of a cat file, with optional search mask\n");
300
	printf ( "\t-x <catfile::filename> [dir]\n");
300
	wprintf(L"\t-x <catfile::filename> [dir]\n");
301
	printf ( "\t\textracts a file from a cat file to the optional directory\n");
301
	wprintf(L"\t\textracts a file from a cat file to the optional directory\n");
302
	printf ( "\t-xp <catfile::filename> [dir]\n");
302
	wprintf(L"\t-xp <catfile::filename> [dir]\n");
303
	printf ( "\t\textracts a file from a cat file to the optional directory, preserves directory structure\n");
303
	wprintf(L"\t\textracts a file from a cat file to the optional directory, preserves directory structure\n");
304
	printf ( "\t-xa <catfile> [dir]\n");
304
	wprintf(L"\t-xa <catfile> [dir]\n");
305
	printf ( "\t\textracts all files to optional directory\n");
305
	wprintf(L"\t\textracts all files to optional directory\n");
306
	printf ( "\t-a <filename> <catfile::tofile>\n");
306
	wprintf(L"\t-a <filename> <catfile::tofile>\n");
307
	printf ( "\t\tAdds the file into a cat archive, saves it as <tofile>\n");
307
	wprintf(L"\t\tAdds the file into a cat archive, saves it as <tofile>\n");
308
	printf ( "\t-r <catfile> <file>\n");
308
	wprintf(L"\t-r <catfile> <file>\n");
309
	printf ( "\t\tRemoves a file from an archive\n");
309
	wprintf(L"\t\tRemoves a file from an archive\n");
310
	printf ( "\t[--ext:EXTENSION] -u <filename> [tofile]\n");
310
	wprintf(L"\t[--ext:EXTENSION] -u <filename> [tofile]\n");
311
	printf ( "\t\tUnpacks a file, ie from pck to xml/txt\n");
311
	wprintf(L"\t\tUnpacks a file, ie from pck to xml/txt\n");
312
	printf ( "\t-p <filename> <tofile>\n");
312
	wprintf(L"\t-p <filename> <tofile>\n");
313
	printf ( "\t\tPacks a file, ie from xml/txt to pck\n");
313
	wprintf(L"\t\tPacks a file, ie from xml/txt to pck\n");
314
}
314
}
315
 
315
 
316
int main ( int argc, char **argv )
316
int main ( int argc, char **argv )
317
{
317
{
318
	printf ( "\nCATPCK Tool V1.21 27/03/2011 (SPK: %.2f) Created by Cycrow\n\n", GetLibraryVersion() );
318
	printf ( "\nCATPCK Tool V1.21 27/03/2011 (SPK: %.2f) Created by Cycrow\n\n", GetLibraryVersion() );
Line 336... Line 336...
336
		if (g_dir.empty())
336
		if (g_dir.empty())
337
			g_dir = L"./";
337
			g_dir = L"./";
338
	}
338
	}
339
 
339
 
340
	if ( argc < 2 )
340
	if ( argc < 2 )
341
		PrintSyntax(CyString(cmd.toString()));
341
		PrintSyntax(cmd);
342
	else
342
	else
343
	{
343
	{
344
		Utils::WString sCommand;
344
		Utils::WString sCommand;
345
		for (int i = 1; i < argc; ++i)
345
		for (int i = 1; i < argc; ++i)
346
			sCommand = sCommand.addToken(L" ", Utils::WString(argv[i]));	
346
			sCommand = sCommand.addToken(L" ", Utils::WString(argv[i]));	
Line 434... Line 434...
434
				PackFile(args[1], args[2]);
434
				PackFile(args[1], args[2]);
435
		}
435
		}
436
		else
436
		else
437
		{
437
		{
438
			wprintf(L"Invalaid flag: %s\n\n", command.c_str());
438
			wprintf(L"Invalaid flag: %s\n\n", command.c_str());
439
			PrintSyntax(CyString(cmd.toString()));
439
			PrintSyntax(cmd);
440
		}
440
		}
441
	}
441
	}
442
 
442
 
443
#ifdef _DEBUG
443
#ifdef _DEBUG
444
	char pause;
444
	char pause;