]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/main.cc
* scm/lily.scm (completize-formats): new function
[lilypond.git] / lily / main.cc
index 918faa08c9787ad46780f83229ea331bb9033f74..b2a55d1ae8df5cb7ba28fc9ae2754d7be293950c 100644 (file)
@@ -46,7 +46,8 @@ bool no_layout_global_b = false;
 /* Selected output format.
    One of tex, ps, scm, as.
 */
-String output_format_global = "tex";
+String output_backend_global = "ps";
+String output_format_global = "pdf";
 
 /* Current output name. */
 String output_name_global;
@@ -62,13 +63,9 @@ bool verbose_global_b = false;
 */
 String init_scheme_code_string = "(begin #t ";
 
-bool make_pdf = false;
-bool make_dvi = false;
-bool make_ps = false;
-bool make_png = false;
 bool make_preview = false;
 bool make_pages = true;
-bool make_tex = false;
+
 
 /*
  * Miscellaneous global stuff.
@@ -127,7 +124,8 @@ static Long_option_init options_static[] =
      _i ("set option, use -e '(ly:option-usage)' for help")},
     /* Bug in option parser: --output =foe is taken as an abbreviation
        for --output-format.  */
-    {_i ("EXT"), "format", 'f', _i ("select back-end to use")},
+    {_i ("EXT"), "backend", 'b', _i ("select back-end to use")},
+    {_i ("EXTs"), "format", 'f', _i ("list of formats to dump")},
     {0, "help", 'h',  _i ("print this help")},
     {_i ("FIELD"), "header", 'H',  _i ("write header field to BASENAME.FIELD")},
     {_i ("DIR"), "include", 'I',  _i ("add DIR to search path")},
@@ -251,44 +249,6 @@ prepend_load_path (String dir)
   scm_c_eval_string (s.to_str0 ());
 }
 
-static void
-determine_output_options ()
-{
-  bool found_gnome = (output_format_global == "gnome");
-  bool found_svg = (output_format_global == "svg");
-  bool found_tex = (output_format_global == "tex");
-
-
-  if (make_pdf || make_png)
-    {
-      make_ps = true;
-    }
-  if (make_ps && found_tex)
-    {
-      make_dvi = true;
-    }
-  if (make_dvi && found_tex)
-    {
-      make_tex = true;
-    }
-  if (!found_gnome
-      && !found_svg
-      && !(make_dvi
-          || make_tex
-          || make_ps
-          || make_png
-          || make_pdf))
-    {
-      make_pdf = true;
-      make_ps = true;
-      if (found_tex)
-       {
-         make_dvi = true;
-         make_tex = true;
-       }
-    }
-}
-
 void init_global_tweak_registry ();
 
 static void
@@ -310,7 +270,6 @@ main_with_guile (void *, int, char **)
   call_constructors ();
   init_global_tweak_registry ();
   init_freetype ();
-  determine_output_options ();  
   all_fonts_global = new All_font_metrics (global_path.to_string ());
 
   init_scheme_code_string += ")";
@@ -339,7 +298,7 @@ main_with_guile (void *, int, char **)
       exit (2);
     }
 
-  SCM result = scm_call_1 (ly_scheme_function ("lilypond-main"), files);
+  SCM result = scm_call_1 (ly_lily_module_constant ("lilypond-main"), files);
   (void) result;
 
 
@@ -409,15 +368,14 @@ parse_argv (int argc, char **argv)
          warranty ();
          exit (0);
          break;
+       case 'b':
+         output_backend_global = option_parser->optional_argument_str0_;
+         break;
+
        case 'f':
-         if (option_parser->optional_argument_str0_ == "help")
-           {
-             printf (_ ("This option is for developers only.").to_str0 ());
-             printf (_ ("Read the sources for more information.").to_str0 ());
-             exit (0);
-           }
          output_format_global = option_parser->optional_argument_str0_;
          break;
+         
        case 'H':
          dump_header_fieldnames_global
            .push (option_parser->optional_argument_str0_);