]> git.donarmstrong.com Git - lilypond.git/blob - main.cc
release: 0.0.7
[lilypond.git] / main.cc
1 #include <iostream.h>
2 #include <assert.h>
3 #include "lgetopt.hh"
4 #include "misc.hh"
5 #include "string.hh"
6 #include "main.hh"
7
8 extern void parse_file(String s);
9
10 long_option_init theopts[] = {
11     1, "output", 'o',
12     0, "warranty", 'w',
13     0,0,0
14 };
15
16
17 void notice()
18 {
19     cout <<
20         "LilyPond, a music typesetter.\n"
21         "Copyright (C) 1996 by\n"
22         "  Han-Wen Nienhuys <hanwen@stack.urc.tue.nl>\n"
23         "\n"
24         "\n"
25         "    This program is free software; you can redistribute it and/or\n"
26         "modify it under the terms of the GNU General Public License version 2\n"
27         "as published by the Free Software Foundation.\n"
28         "\n"
29         "    This program is distributed in the hope that it will be useful,\n"
30         "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
31         "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n"
32         "General Public License for more details.\n"
33         "\n"
34         "    You should have received a copy (refer to the file COPYING) of the\n"
35         "GNU General Public License along with this program; if not, write to\n"
36         "the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,\n"
37         "USA.\n";
38 }
39
40 int
41 main (int argc, char **argv)
42 {
43     Getopt_long oparser(argc, argv,theopts);
44     debug_init();
45     cout << get_version();
46     
47     while (long_option_init * opt = oparser()) {
48         switch ( opt->shortname){
49         case 'o':
50             set_default_output(oparser.optarg);
51             break;
52         case 'w':
53             notice();
54             exit(0);
55             break;
56         default:
57             assert(false);
58             break;
59         }
60     }
61     char *arg = oparser.get_next_arg();
62
63     if (!arg) arg = "";
64     parse_file(arg);
65
66     do_scores();
67     exit (0);
68 }