lilypond-0.0.4
[lilypond.git] / main.cc
blob21453315654c0119aa24e9faa1d6e94dd2831fe4
1 #include <iostream.h>
2 #include <assert.h>
3 #include "lgetopt.hh"
4 #include "misc.hh"
5 #include "string.hh"
6 #include "main.hh"
8 extern void parse_file(String s);
10 long_option_init theopts[] = {
11 1, "output", 'o',
12 0, "warranty", 'w',
13 0,0,0
17 void notice()
19 cout <<
20 "LilyPond, a music typesetter.
21 Copyright (C) 1996 by
22 Han-Wen Nienhuys <hanwen@stack.urc.tue.nl>
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.
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.
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.
41 int
42 main (int argc, char **argv)
44 Getopt_long oparser(argc, argv,theopts);
46 cout << get_version();
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;
62 char *arg = oparser.get_next_arg();
64 if (!arg) arg = "";
65 parse_file(arg);
67 do_scores();
68 exit (0);