]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/main.cc
* VERSION (MY_PATCH_LEVEL): make 1.7.0
[lilypond.git] / lily / main.cc
index d0c12ef46e3ac64d9ab9b835acee926890040259..dd856b5a810d78b748a851e8fde2f1374409c208 100644 (file)
@@ -26,7 +26,7 @@
 #include "string.hh"
 #include "main.hh"
 #include "file-path.hh"
-#include "file-results.hh"
+#include "input-file-results.hh"
 #include "warn.hh"
 #include "lily-guile.hh"
 #include "paper-def.hh"
@@ -103,11 +103,11 @@ static Getopt_long *oparser_p_static = 0;
        follow regular localisation guidelines).
  */
 static Long_option_init options_static[] = {
-  /* print example usage:  lilypond -e "" ? */
-  {_i ("EXPR"), "evaluate", 'e',_i ("Scheme options: try -e \"(set-lily-option 'help 0)\" for more help.")},
+  {_i ("EXPR"), "evaluate", 'e',
+   _i ("set options, use -e '(ly-option-usage)' for help")},
   /* another bug in option parser: --output=foe is taken as an abbreviation
      for --output-format */
-  {_i ("EXT"), "format", 'f',  _i ("use output format EXT")},
+  {_i ("EXT"), "format", 'f', _i ("use output format EXT")},
   {0, "help", 'h',  _i ("this help")},
   {_i ("FIELD"), "header", 'H',  _i ("write header field to BASENAME.FIELD")},
   {_i ("DIR"), "include", 'I',  _i ("add DIR to search path")},
@@ -263,7 +263,7 @@ setup_paths ()
     for (char **s = suffixes; *s; s++)
       {
        String p = prefix_directory[i] + to_string ('/') + String (*s);
-       global_path.add (p);
+       global_path.prepend (p);
        
 #if !KPATHSEA
        /* Urg: GNU make's $ (word) index starts at 1 */
@@ -337,13 +337,12 @@ main_prog (void *, int, char **)
       prepend_load_path (String (prefix_directory[i]) + "/scm");
     }
 
-  SCM_RECORD_POSITIONS_P = 1; 
   if (verbose_global_b)
     dirinfo (stderr);
   
   ly_init_guile ();
 
-  printf ("\n");
+  progress_indication ("\n");
 
   call_constructors ();
   all_fonts_global = new All_font_metrics (global_path.string ());
@@ -353,7 +352,17 @@ main_prog (void *, int, char **)
   
   int p=0;
   const char *arg  = oparser_p_static->get_next_arg ();
-  
+
+  /* Only exit until after running init_scheme_code, for
+     (ly-option-usage) or
+     -e "(ly-set-option 'help #t)" */
+  if (!arg)
+    {
+      usage ();
+      /* No FILE arguments is now a usage error */
+      exit (2);
+    }
+
   do
     {
       String infile (arg);
@@ -506,21 +515,7 @@ main (int argc, char **argv)
       exit (0);
     }
 
-
-  if (!oparser_p_static->current_arg () )
-    {
-      usage ();
-      /* No FILE arguments is now a usage error */
-      exit (2);
-    }
-
-#ifdef WINNT
-  scm_boot_guile (argc, argv, main_prog, 0);
-#else
   scm_boot_guile (argc, argv, (void (*) (void*, int, char**))main_prog, 0);
-#endif
 
   return 0;                    // unreachable
 }
-
-