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