lilypond-0.0.3
[lilypond.git] / main.cc
blob3758840ac6abd726bbbce72abf233f730a2f62e4
1 #include <iostream.h>
2 #include "lgetopt.hh"
3 #include "misc.hh"
4 #include "debug.hh"
5 #include "score.hh"
6 #include "globvars.hh"
8 extern void parse_file(String s);
9 Score *the_score =0;
11 long_option_init theopts[] = {
12 1, "debug", 'd',
13 1, "output", 'o',
14 0,0,0
18 String outfn="lelie.uit";
20 void
21 set_output(String s)
23 outfn = s;
26 int
27 main (int argc, char **argv)
29 Getopt_long oparser(argc, argv,theopts);
31 cout << get_version()
32 << "copyright 1996 Han-Wen Nienhuys\n";
34 while (long_option_init * opt = oparser()) {
35 switch ( opt->shortname){
36 case 'd':
37 set_debug(oparser.optarg);
38 break;
39 case 'o':
40 set_output(oparser.optarg);
41 break;
42 default:
43 assert(false);
44 break;
47 char *arg = oparser.get_next_arg();
49 if (!arg) arg = "";
50 parse_file(arg);
52 the_score->process();
53 the_score->output(outfn);