11 #include "source-file.hh"
15 Source
* source_l_g
= &source
;
17 bool only_midi
= false;
18 extern void parse_file(String
,String
);
22 destill_inname( String
&name_str_r
);
23 Long_option_init theopts
[] = {
38 "--help, -h This help\n"
39 "--warranty, -w show warranty & copyright\n"
40 "--output, -o set default output\n"
41 "--debug, -d enable debug output\n"
42 "--init, -i set init file\n"
43 "--include, -I add to file search path.\n"
44 "--midi, -M midi output only\n"
54 "LilyPond, a music typesetter.\n"
55 "Copyright (C) 1996,97 by\n"
56 " Han-Wen Nienhuys <hanwen@stack.nl>\n"
58 " Jan Nieuwenhuizen <jan@digicash.com>\n"
59 " Mats Bengtsson <matsb@s3.kth.se>\n"
61 " This program is free software; you can redistribute it and/or\n"
62 "modify it under the terms of the GNU General Public License version 2\n"
63 "as published by the Free Software Foundation.\n"
65 " This program is distributed in the hope that it will be useful,\n"
66 "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
67 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
68 "General Public License for more details.\n"
70 " You should have received a copy (refer to the file COPYING) of the\n"
71 "GNU General Public License along with this program; if not, write to\n"
72 "the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,\n"
76 static File_path
* path
=0;
79 path
= new File_path(LIBDIR
);
80 path
->push(String(LIBDIR
)+"init/");
89 main (int argc
, char **argv
)
91 Getopt_long
oparser(argc
, argv
,theopts
);
92 cout
<< get_version();
93 String
init_str("symbol.ini");
95 while (Long_option_init
* opt
= oparser()) {
96 switch ( opt
->shortname
){
98 set_default_output(oparser
.optarg
);
105 path
->push(oparser
.optarg
);
108 init_str
= oparser
.optarg
;
128 while ( (arg
= oparser
.get_next_arg()) ) {
132 parse_file(init_str
,f
);
137 parse_file(init_str
, "");
147 return path
->find(f
);
150 /// make input file name: add default extension. "" is stdin.
152 destill_inname( String
&name_str_r
)
154 if ( name_str_r
.length_i() )
156 if( name_str_r
[ 0 ] != '-' )
159 split_path(name_str_r
,a
,b
,c
,d
);
161 // add extension if not present.
164 name_str_r
= a
+b
+c
+d
;
166 } else name_str_r
= "";