diff options
Diffstat (limited to 'src/tools/mkgenome.c')
| -rw-r--r-- | src/tools/mkgenome.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/tools/mkgenome.c b/src/tools/mkgenome.c index bb2e787..3bf1533 100644 --- a/src/tools/mkgenome.c +++ b/src/tools/mkgenome.c @@ -2,13 +2,22 @@ src/tools/build.zc) into genome.h */ #include <stdio.h> #include <stdint.h> +#include <string.h> #ifdef _WIN32 #include <fcntl.h> #include <io.h> #endif #include "memmap.h" -int main(void) +int main(int argc, char **argv) { + if (argc == 2 && (!strcmp(argv[1], "--help") || !strcmp(argv[1], "-h"))) { + fputs("usage: mkgenome [--help|-h] < image.bin > genome.h\n" + "converts little-endian 64-bit image words into a c genome header.\n" + "the image must match the memory layout selected when mkgenome is built.\n" + "options:\n --help, -h show this help and exit\n", stdout); + return 0; + } + if (argc != 1) { fputs("mkgenome: unexpected arguments; use --help for usage\n", stderr); return 2; } #ifdef _WIN32 _setmode(_fileno(stdin), _O_BINARY); _setmode(_fileno(stdout), _O_BINARY); |
