CVSROOT:        /cvsroot/lilypond
Module name:    lilypond
Branch:         
Changes by:     Jan Nieuwenhuizen <[EMAIL PROTECTED]>   05/05/10 07:22:17

Modified files:
        scm            : safe-lily.scm lily.scm 
        lily           : main.cc 
        .              : ChangeLog 

Log message:
        

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/safe-lily.scm.diff?tr1=1.28&tr2=1.29&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/lily.scm.diff?tr1=1.332&tr2=1.333&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/main.cc.diff?tr1=1.246&tr2=1.247&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.3583&tr2=1.3584&r1=text&r2=text

Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.3583 lilypond/ChangeLog:1.3584
--- lilypond/ChangeLog:1.3583   Mon May  9 21:08:37 2005
+++ lilypond/ChangeLog  Tue May 10 07:22:17 2005
@@ -21,6 +21,14 @@
 
 2005-05-09  Jan Nieuwenhuizen  <[EMAIL PROTECTED]>
 
+       * lily/main.cc (main_with_guile): Remove no files check.
+
+       * lily/main.cc (ly:usage): Export to Scheme.
+
+       * scm/lily.scm (no-files-handler): New function.
+
+       * scm/lily.scm (lilypond-main): Use it.
+
        * configure.in (gui_b): Add mbrtowc checking.
        Resurrect [utf8/]wchar.h checking.
 
Index: lilypond/lily/main.cc
diff -u lilypond/lily/main.cc:1.246 lilypond/lily/main.cc:1.247
--- lilypond/lily/main.cc:1.246 Wed May  4 10:11:32 2005
+++ lilypond/lily/main.cc       Tue May 10 07:22:17 2005
@@ -207,8 +207,9 @@
   copyright ();
 }
 
-static void
-usage ()
+LY_DEFINE (ly_usage, "ly:usage",
+          0, 0, 0, (),
+          "Print usage message.")
 {
   /* No version number or newline here.  It confuses help2man.  */
   printf (_f ("Usage: %s [OPTION]... FILE...", PROGRAM_NAME).to_str0 ());
@@ -226,6 +227,7 @@
   printf (_f ("Report bugs to %s.", "bug-lilypond@gnu.org").to_str0 ());
   printf ("\n");
   printf ("\n");
+  return SCM_UNSPECIFIED;
 }
 
 static void
@@ -439,17 +441,8 @@
   delete option_parser;
   option_parser = 0;
 
-  if (files == SCM_EOL)
-    {
-      /* No FILE arguments is now a usage error to help newbies.  If you
-        want a filter, you're not a newbie and should know to use file
-        argument `-'.  */
-      usage ();
-      exit (2);
-    }
-
 #if HAVE_CHROOT
-  if (! jail_spec.is_empty ())
+  if (!jail_spec.is_empty ())
     do_chroot_jail ();
 #endif
 
@@ -590,7 +583,7 @@
   if (show_help)
     {
       identify (stdout);
-      usage ();
+      ly_usage ();
       if (be_verbose_global)
        dir_info (stdout);
       exit (0);
Index: lilypond/scm/lily.scm
diff -u lilypond/scm/lily.scm:1.332 lilypond/scm/lily.scm:1.333
--- lilypond/scm/lily.scm:1.332 Sun May  8 23:17:49 2005
+++ lilypond/scm/lily.scm       Tue May 10 07:22:16 2005
@@ -298,8 +298,16 @@
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+(define (no-files-handler)
+  (ly:usage)
+  (exit 2))
+
 (define-public (lilypond-main files)
   "Entry point for LilyPond."
+
+  (if (null? files)
+      (no-files-handler))
+
   (let* ((failed '())
         (handler (lambda (key failed-file)
             (set! failed (append (list failed-file) failed)))))
Index: lilypond/scm/safe-lily.scm
diff -u lilypond/scm/safe-lily.scm:1.28 lilypond/scm/safe-lily.scm:1.29
--- lilypond/scm/safe-lily.scm:1.28     Tue Apr 12 22:49:25 2005
+++ lilypond/scm/safe-lily.scm  Tue May 10 07:22:16 2005
@@ -142,6 +142,7 @@
    ly:translator?
    ly:transpose-key-alist
    ly:unit
+   ly:usage
    ly:version
    ly:warning
 


_______________________________________________
Lilypond-cvs mailing list
Lilypond-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-cvs

Reply via email to