mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-08 05:27:35 +02:00
adding release-name and features to -V option
This commit is contained in:
parent
4a5cae51ae
commit
85298f69e1
2 changed files with 10 additions and 2 deletions
|
@ -13,7 +13,7 @@ chibi-scheme \- a tiny Scheme interpreter
|
||||||
[-A
|
[-A
|
||||||
.I path
|
.I path
|
||||||
]
|
]
|
||||||
[-u
|
[-m
|
||||||
.I module
|
.I module
|
||||||
]
|
]
|
||||||
[-l
|
[-l
|
||||||
|
|
10
main.c
10
main.c
|
@ -10,6 +10,8 @@
|
||||||
#define sexp_import_prefix "(import ("
|
#define sexp_import_prefix "(import ("
|
||||||
#define sexp_import_suffix "))"
|
#define sexp_import_suffix "))"
|
||||||
|
|
||||||
|
#define sexp_version_string "chibi-scheme "sexp_version" \""sexp_release_name"\" "
|
||||||
|
|
||||||
#ifdef PLAN9
|
#ifdef PLAN9
|
||||||
#define exit_failure() exits("ERROR")
|
#define exit_failure() exits("ERROR")
|
||||||
#else
|
#else
|
||||||
|
@ -152,7 +154,13 @@ void run_main (int argc, char **argv) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
printf("chibi-scheme 0.3\n");
|
load_init();
|
||||||
|
if (! sexp_oportp(out))
|
||||||
|
out = sexp_eval_string(ctx, "(current-output-port)", env);
|
||||||
|
sexp_write_string(ctx, sexp_version_string, out);
|
||||||
|
tmp = sexp_env_ref(env, sexp_intern(ctx, "*features*"), SEXP_NULL);
|
||||||
|
sexp_write(ctx, tmp, out);
|
||||||
|
sexp_newline(ctx, out);
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "unknown option: %s\n", argv[i]);
|
fprintf(stderr, "unknown option: %s\n", argv[i]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue