(uxnasm.c) Add check for missing output file
This commit is contained in:
parent
798ebafdc8
commit
76732db18a
|
@ -498,10 +498,10 @@ int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
FILE *src, *dst;
|
FILE *src, *dst;
|
||||||
if(argc == 1)
|
if(argc == 2 && argv[1][0] == '-' && argv[1][1] == 'v')
|
||||||
return error("usage", "uxnasm [-v] input.tal output.rom");
|
|
||||||
if(argv[1][0] == '-' && argv[1][1] == 'v')
|
|
||||||
return !fprintf(stdout, "Uxnasm - Uxntal Assembler, 27 Oct 2023.\n");
|
return !fprintf(stdout, "Uxnasm - Uxntal Assembler, 27 Oct 2023.\n");
|
||||||
|
if (argc != 3)
|
||||||
|
return error("usage", "uxnasm [-v] input.tal output.rom");
|
||||||
if(!(src = fopen(argv[1], "r")))
|
if(!(src = fopen(argv[1], "r")))
|
||||||
return !error("Invalid input", argv[1]);
|
return !error("Invalid input", argv[1]);
|
||||||
if(!assemble(src))
|
if(!assemble(src))
|
||||||
|
|
Loading…
Reference in New Issue