#include "support/lyxlib.h"
#include "support/os.h"
#include "support/package.h"
+#include "support/unicode.h"
#include <boost/function.hpp>
#include <boost/filesystem/operations.hpp>
#include <vector>
#include <map>
+
+namespace lyx {
+
using std::endl;
using std::cout;
using std::cerr;
namespace fs = boost::filesystem;
+IconvProcessor & utf8ToUcs4()
+{
+ static IconvProcessor iconv(ucs4_codeset, "UTF-8");
+ return iconv;
+}
+
+
// Hacks to allow the thing to link in the lyxlayout stuff
LyXErr lyxerr(std::cerr.rdbuf());
}
+bool noweb_mode = false;
+
+
namespace {
"\t-userdir dir try to set user directory to dir\n"
"\t-sysdir dir try to set system directory to dir\n"
"\t-c textclass declare the textclass\n"
+ "\t-n translate a noweb (aka literate programming) file.\n"
"\t-s syntaxfile read additional syntax file" << endl;
exit(0);
}
}
+int parse_noweb(string const &, string const &)
+{
+ noweb_mode = true;
+ return 0;
+}
+
+
void easyParse(int & argc, char * argv[])
{
map<string, cmd_helper> cmdmap;
cmdmap["-s"] = parse_syntaxfile;
cmdmap["-help"] = parse_help;
cmdmap["--help"] = parse_help;
+ cmdmap["-n"] = parse_noweb;
cmdmap["-sysdir"] = parse_sysdir;
cmdmap["-userdir"] = parse_userdir;
return tex2lyx(infilename, os);
}
+} // namespace lyx
+
int main(int argc, char * argv[])
{
+ using namespace lyx;
fs::path::default_name_check(fs::no_check);
easyParse(argc, argv);