From: Jan Nieuwenhuizen Date: Tue, 10 May 2005 07:22:17 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/2.5.24~24 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2be8f5718c0225121ab1e45b46767df41cdc26a9;p=lilypond.git *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index 8c4db0e375..6f5e58f0f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,14 @@ 2005-05-09 Jan Nieuwenhuizen + * 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. diff --git a/lily/main.cc b/lily/main.cc index 5a746d6fad..1a76689c32 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -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); diff --git a/scm/lily.scm b/scm/lily.scm index 4c0f0abc94..b420e3152c 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -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))))) diff --git a/scm/safe-lily.scm b/scm/safe-lily.scm index 5c156883b6..c0076d1768 100644 --- a/scm/safe-lily.scm +++ b/scm/safe-lily.scm @@ -142,6 +142,7 @@ ly:translator? ly:transpose-key-alist ly:unit + ly:usage ly:version ly:warning