2007-11-30 06:51:15 -05:00
|
|
|
/*
|
|
|
|
* Ikarus Scheme -- A compiler for R6RS Scheme.
|
2008-01-29 00:34:34 -05:00
|
|
|
* Copyright (C) 2006,2007,2008 Abdulaziz Ghuloum
|
2007-11-30 06:51:15 -05:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 3 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2008-08-09 08:47:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
#include "ikarus-main.h"
|
|
|
|
#include "bootfileloc.h"
|
2007-11-30 06:51:15 -05:00
|
|
|
#include <stdio.h>
|
2007-12-10 15:02:25 -05:00
|
|
|
#include <string.h>
|
2008-08-09 08:47:44 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
void ikarus_usage_short(){
|
|
|
|
fprintf(stderr, "scheme-script <script-name> arguments ...\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
void ikarus_usage(){
|
|
|
|
static char* helpstring =
|
|
|
|
"Usage: \n\
|
|
|
|
scheme-script <script-name> arguments ...\n\
|
|
|
|
\n\
|
|
|
|
Runs the file <script-name> as a Scheme script, passing\n\
|
|
|
|
arguments ... as (command-line)\n\
|
|
|
|
\n\
|
|
|
|
Consult the Ikarus Scheme User's Guide for more details.\n\n";
|
2008-12-23 20:41:12 -05:00
|
|
|
fprintf(stderr, "%s", helpstring);
|
2008-08-09 08:47:44 -04:00
|
|
|
}
|
2007-11-30 06:51:15 -05:00
|
|
|
|
|
|
|
int main(int argc, char** argv){
|
2008-08-09 08:47:44 -04:00
|
|
|
if(argc < 2) {
|
|
|
|
ikarus_usage();
|
2007-11-30 06:51:15 -05:00
|
|
|
exit(-1);
|
|
|
|
}
|
2008-08-09 08:47:44 -04:00
|
|
|
char* boot_file = BOOTFILE;
|
|
|
|
char** args = calloc(sizeof(char*), argc+1);
|
|
|
|
args[0] = argv[0];
|
|
|
|
args[1] = "--r6rs-script";
|
|
|
|
int i;
|
|
|
|
for(i=1; i<argc; i++){
|
|
|
|
args[i+1] = argv[i];
|
|
|
|
}
|
|
|
|
return ikarus_main(argc+1, args, boot_file);
|
2007-11-30 06:51:15 -05:00
|
|
|
}
|
|
|
|
|
2008-08-09 08:47:44 -04:00
|
|
|
|