void
ParseTextOptions
	(
	const int	argc,
	char*		argv[]
	)
{
	long index = 1;
	while (index < argc)
		{
		if (JIsVersionRequest(argv[index]))
			{
			THXApp::InitStrings();
			PrintVersion();
			exit(0);
			}
		else if (JIsHelpRequest(argv[index]))
			{
			THXApp::InitStrings();
			THXMDIServer::PrintCommandLineHelp();
			exit(0);
			}
		index++;
		}
}
void
ParseTextOptions
	(
	const int	argc,
	char*		argv[]
	)
{
	long index = 1;
	while (index < argc)
		{
		if (JIsVersionRequest(argv[index]))
			{
			PrintVersion();
			exit(0);
			}
		else if (JIsHelpRequest(argv[index]))
			{
			PrintHelp();
			exit(0);
			}
		index++;
		}
}
void
GetOptions
	(
	const JSize			argc,
	char*				argv[],
	JPtrArray<JString>*	inputFileList,
	JString*			dataVarName,
	JString*			outputFileName,
	JString*			databaseFileName,
	JBoolean*			debug
	)
{
	inputFileList->CleanOut();
	dataVarName->Clear();
	outputFileName->Clear();
	databaseFileName->Clear();
	*debug = kJFalse;

	JIndex index = 1;
	while (index < argc)
		{
		if (JIsVersionRequest(argv[index]))
			{
			PrintVersion();
			exit(0);
			}
		else if (JIsHelpRequest(argv[index]))
			{
			PrintHelp();
			exit(0);
			}

		else if (strcmp(argv[index], "--code") == 0)
			{
			JCheckForValues(2, &index, argc, argv);
			*dataVarName    = argv[index];
			*outputFileName = argv[index+1];
			index++;
			}

		else if (strcmp(argv[index], "--db") == 0)
			{
			JCheckForValues(1, &index, argc, argv);
			*databaseFileName = argv[index];
			}

		else if (strcmp(argv[index], "--debug") == 0)
			{
			*debug = kJTrue;
			}

		else if (argv[index][0] == '-')
			{
			cerr << argv[0] << ": unknown command line option: " << argv[index] << endl;
			}

		else
			{
			JString* inputFileName = new JString(argv[index]);
			assert( inputFileName != NULL );

			if (inputFileName->EndsWith("~") ||
				inputFileName->BeginsWith("#"))
				{
				delete inputFileName;
				}
			else
				{
				inputFileList->Append(inputFileName);
				}
			}

		index++;
		}

	if (inputFileList->IsEmpty())
		{
		cerr << argv[0] << ": no input files" << endl;
		exit(1);
		}
}