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