11 #include "sourcefile.hh"
15 Source* source_l = &source;
17 extern void parse_file(String,String);
21 destill_inname( String &inName);
22 long_option_init theopts[] = {
36 "--help, -h This help\n"
37 "--warranty, -w show warranty & copyright\n"
38 "--output, -o set default output\n"
39 "--debug, -d enable debug output\n"
40 "--init, -i set init file\n"
41 "--include, -I add to file search path.\n"
50 "LilyPond, a music typesetter.\n"
51 "Copyright (C) 1996,97 by\n"
52 " Han-Wen Nienhuys <hanwen@stack.nl>\n"
54 " Jan Nieuwenhuizen <jan@digicash.com>\n"
55 " Mats Bengtsson <matsb@s3.kth.se>\n"
57 " This program is free software; you can redistribute it and/or\n"
58 "modify it under the terms of the GNU General Public License version 2\n"
59 "as published by the Free Software Foundation.\n"
61 " This program is distributed in the hope that it will be useful,\n"
62 "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
63 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
64 "General Public License for more details.\n"
66 " You should have received a copy (refer to the file COPYING) of the\n"
67 "GNU General Public License along with this program; if not, write to\n"
68 "the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,\n"
72 static File_path * path =0;
75 path = new File_path(LIBDIR);
76 path->push(String(LIBDIR)+"init/");
85 main (int argc, char **argv)
87 Getopt_long oparser(argc, argv,theopts);
88 cout << get_version();
89 String init_str("symbol.ini");
91 while (long_option_init * opt = oparser()) {
92 switch ( opt->shortname){
94 set_default_output(oparser.optarg);
101 path->push(oparser.optarg);
104 init_str = oparser.optarg;
121 while ( (arg= oparser.get_next_arg()) ) {
124 parse_file(init_str,f);
129 parse_file(init_str, "");
139 return path->find(f);
142 /// make input file name: add default extension. "" is stdin.
144 destill_inname( String &inName)
148 if( inName[ 0 ] != '-' )
151 split_path(inName,a,b,c,d);
153 // add extension if not present.