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.
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 ());
printf (_f ("Report bugs to %s.", "bug-lilypond@gnu.org").to_str0 ());
printf ("\n");
printf ("\n");
+ return SCM_UNSPECIFIED;
}
static void
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
if (show_help)
{
identify (stdout);
- usage ();
+ ly_usage ();
if (be_verbose_global)
dir_info (stdout);
exit (0);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(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)))))