summaryrefslogtreecommitdiff
path: root/src/compilo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compilo.c')
-rw-r--r--src/compilo.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/compilo.c b/src/compilo.c
index 883bd81..61ea761 100644
--- a/src/compilo.c
+++ b/src/compilo.c
@@ -12,7 +12,12 @@
typedef void (*sighandler_t)(int);
void invite(void) {
- fprintf(stderr, _("Assembler\n\n"));
+ fprintf(stderr, _("Assembler v1.0\n\n"));
+}
+
+void usage(void) {
+ fprintf(stderr, _("Usage: compilo program.asm objet.out\n"));
+ exit(0);
}
void init_all(void) {
@@ -46,15 +51,17 @@ void segfaulthand(int i) {
exception(1, _("Signal received: segfault"));
}
-int main(void) {
+int main(int argc, char ** argv) {
invite();
/* signal(SIGSEGV, segfaulthand); */
+
+ if (argc != 3) usage();
fprintf(stderr, _("\nPerforming initialisation...\n\n"));
init_all();
-
- assemble_file("progtest.asm", "progtest.o");
+
+ assemble_file(argv[1], argv[2]);
fprintf(stderr, _("\nPerforming shutdown...\n\n"));
flush_all();