]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/tex2lyx.cpp
tex2lyx: support for subfloats
[lyx.git] / src / tex2lyx / tex2lyx.cpp
index d5538d8c3683b74d9e7e2f2aa08970cd74f539a9..8e3809cadcaf2eee13f48fc610a9b7106e15c0c2 100644 (file)
@@ -94,21 +94,9 @@ void lyx_exit(int)
 {}
 
 
-string const trim(string const & a, char const * p)
+string const trimSpaceAndEol(string const & a)
 {
-       // LASSERT(p, /**/);
-
-       if (a.empty() || !*p)
-               return a;
-
-       size_t r = a.find_last_not_of(p);
-       size_t l = a.find_first_not_of(p);
-
-       // Is this the minimal test? (lgb)
-       if (r == string::npos && l == string::npos)
-               return string();
-
-       return a.substr(l, r - l + 1);
+       return trim(a, " \t\n\r");
 }
 
 
@@ -161,6 +149,7 @@ CommandMap known_environments;
 CommandMap known_math_environments;
 FullCommandMap possible_textclass_commands;
 FullEnvironmentMap possible_textclass_environments;
+int const LYX_FORMAT = LYX_FORMAT_TEX2LYX;
 
 /// used modules
 LayoutModuleList used_modules;
@@ -576,8 +565,10 @@ void easyParse(int & argc, char * argv[])
 {
        map<string, cmd_helper> cmdmap;
 
+       cmdmap["-h"] = parse_help;
        cmdmap["-help"] = parse_help;
        cmdmap["--help"] = parse_help;
+       cmdmap["-v"] = parse_version;
        cmdmap["-version"] = parse_version;
        cmdmap["--version"] = parse_version;
        cmdmap["-c"] = parse_class;