]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/scm-option.cc
* lily/parser.yy (command_element): move clef stuff into Scheme.
[lilypond.git] / lily / scm-option.cc
index e924020aa78624e2e7fa332c23fe054b45d05849..f175b214838f7432f76ab61718d02375cccc8f6d 100644 (file)
@@ -6,8 +6,7 @@
   (c) 2001--2002  Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
-
-#include <iostream.h>
+#include <stdio.h>
 
 #include "string.hh"
 #include "lily-guile.hh"
@@ -39,56 +38,58 @@ int testing_level_global;
  */
 bool internal_type_checking_global_b;
 
-/*
+LY_DEFINE (ly_option_usage, "ly-option-usage", 0, 0, 0, (SCM),
+                 "Print ly-set-option usage")
+{  
+  printf ( _("lilypond -e EXPR means:").to_str0 ());
+  puts ("");
+  printf (_ ("  Evalute the Scheme EXPR before parsing any .ly files.").to_str0 ());
+  puts ("");
+  printf (_ ("  Multiple -e options may be given, they will be evaluated sequentially.").to_str0 ());
+  puts ("");
+  printf (_("  The function ly-set-option allows for access to some internal variables.").to_str0 ());
+  puts ("\n");
+  printf (_ ("Usage: lilypond -e \"(ly-set-option SYMBOL VAL)\"").to_str0 ());
+  puts ("\n");
+  printf (_ ("Where SYMBOL VAL pair is any of:").to_str0 ());
+  puts ("");
+  printf ( "  help ANY-SYMBOL\n"
+          "  internal-type-checking BOOLEAN\n"
+          "  midi-debug BOOLEAN\n"
+          "  testing-level INTEGER\n");
+  
+  exit (0);
+  return SCM_UNSPECIFIED;
+}
 
-add these as well:
+/* Add these as well:
 
 @item -T,--no-timestamps
 don't timestamp the output
 
 @item -t,--test
-Switch on any experimental features.  Not for general public use.
-
- */
-
-LY_DEFINE(set_lily_option,"set-lily-option", 2, 0, 0,  (SCM var, SCM val),
-         "Set a global option for the program. Supported options  include
+Switch on any experimental features.  Not for general public use. */
 
+LY_DEFINE (ly_set_option, "ly-set-option", 2, 0, 0, (SCM var, SCM val),
+           "Set a global option value.  Supported options include
 
 @table @code
 @item help
 List all options.
 @item midi-debug
-If set to true, generate human  readable MIDI
+If set to true, generate human readable MIDI
+@item internal-type-checking
+Set paranoia for property assignments 
 @end table
 
 This function is useful to call from the command line: @code{lilypond -e
-\"(set-lily-option 'midi-debug #t)\"}.
+\"(ly-set-option 'midi-debug #t)\"}.
 ")
 {
-  /*
-    Scheme option usage:
-    lilypond -e "(set-lily-option 'help 0)"
-   */
   if (var == ly_symbol2scm ("help"))
     {
-      cout << _("lilypond -e EXPR means
-
-evalute EXPR as Scheme after init.scm has been read.  In particular,
-the function set-lily-option allows for access to some internal
-variables. Usage:
-
-  (set-lily-option SYMBOL VAL)
-
-possible options for SYMBOL are :
-").ch_C()<<endl;
-      
-      cout << "  help (any-symbol)"<<endl; 
-      cout << "  internal-type-checking (boolean)"<<endl; 
-      cout << "  midi-debug (boolean)"<<endl; 
-      cout << "  testing-level (int)"<<endl; 
-
-      exit (0);
+      /* lilypond -e "(ly-set-option 'help #t)" */
+      ly_option_usage (SCM_EOL);
     }
   else if (var == ly_symbol2scm ("midi-debug"))
     {