]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 10 May 2005 07:22:17 +0000 (07:22 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 10 May 2005 07:22:17 +0000 (07:22 +0000)
ChangeLog
lily/main.cc
scm/lily.scm
scm/safe-lily.scm

index 8c4db0e3750bcd8d83c9c672cdf80bbecbca786b..6f5e58f0f1edf962883fc18b6106ca51b6f8860f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
 2005-05-09  Jan Nieuwenhuizen  <janneke@gnu.org>
 
+       * 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 5a746d6fadbdcc9d5f32dacf32bb78ec332090af..1a76689c3268f097860b2bfd398a7429c7da3933 100644 (file)
@@ -207,8 +207,9 @@ notice ()
   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 @@ usage ()
   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 @@ main_with_guile (void *, int, char **)
   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 @@ parse_argv (int argc, char **argv)
   if (show_help)
     {
       identify (stdout);
-      usage ();
+      ly_usage ();
       if (be_verbose_global)
        dir_info (stdout);
       exit (0);
index 4c0f0abc943ac43fafcc7326aba8a57c6fbf0b00..b420e3152cd989cc284b1aa5be304448546bda82 100644 (file)
@@ -298,8 +298,16 @@ The syntax is the same as `define*-public'."
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+(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 5c156883b67c9dd0133209207fd058a97c1e6346..c0076d1768edad198d964ca2be1ea66aec565b63 100644 (file)
    ly:translator?
    ly:transpose-key-alist
    ly:unit
+   ly:usage
    ly:version
    ly:warning