From c20ff11378676b24f01be82f5cfbb022a0bfaab1 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sat, 4 Feb 2012 16:37:05 +0100 Subject: [PATCH] Give ly:option-usage an optional port argument (issue 2280). --- lily/program-option-scheme.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lily/program-option-scheme.cc b/lily/program-option-scheme.cc index cf5416ae8b..820faf5bfe 100644 --- a/lily/program-option-scheme.cc +++ b/lily/program-option-scheme.cc @@ -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; } -- 2.39.2