]> git.donarmstrong.com Git - lilypond.git/commitdiff
Give ly:option-usage an optional port argument (issue 2280).
authorDavid Kastrup <dak@gnu.org>
Sat, 4 Feb 2012 15:37:05 +0000 (16:37 +0100)
committerDavid Kastrup <dak@gnu.org>
Sat, 4 Feb 2012 15:38:10 +0000 (16:38 +0100)
lily/program-option-scheme.cc

index cf5416ae8b3325ea89fce6c890e5e7a7b7e2ebea..820faf5bfea907bc0f2870001261a036ad12b79e 100644 (file)
@@ -187,12 +187,12 @@ get_help_string ()
   return help;
 }
 
-LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (),
-           "Print @code{ly:set-option} usage.")
+LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 1, 0, (SCM port),
+           "Print @code{ly:set-option} usage.  Optional @var{port} argument"
+          "for the destination defaults to current output port.")
 {
-  string help = get_help_string ();
-  puts (help.c_str ());
-  fflush (stdout);
+  SCM str = scm_from_locale_string (get_help_string ().c_str ());
+  scm_write_line (str, port);
 
   return SCM_UNSPECIFIED;
 }