diff --git a/Manual.md b/Manual.md index 328e9b4..c464552 100644 --- a/Manual.md +++ b/Manual.md @@ -62,6 +62,7 @@ Usage: picasso [options] files... Options: -o, --out= Specifies the name of the SHBIN file to generate -h, --header= Specifies the name of the header file to generate + -v, --version Displays version information ``` DVLEs are generated in the same order as the files in the command line. diff --git a/source/picasso_frontend.cpp b/source/picasso_frontend.cpp index 53330ef..d951222 100644 --- a/source/picasso_frontend.cpp +++ b/source/picasso_frontend.cpp @@ -36,6 +36,7 @@ int usage(const char* prog) "Options:\n" " -o, --out= Specifies the name of the SHBIN file to generate\n" " -h, --header= Specifies the name of the header file to generate\n" + " -v, --version Displays version information\n" , prog); return EXIT_FAILURE; } @@ -49,17 +50,19 @@ int main(int argc, char* argv[]) { "out", required_argument, NULL, 'o' }, { "header", required_argument, NULL, 'h' }, { "help", no_argument, NULL, '?' }, + { "version",no_argument, NULL, 'v' }, { NULL, 0, NULL, 0 } }; int opt, optidx = 0; - while ((opt = getopt_long(argc, argv, "o:h:?", long_options, &optidx)) != -1) + while ((opt = getopt_long(argc, argv, "o:h:?v", long_options, &optidx)) != -1) { switch (opt) { case 'o': shbinFile = optarg; break; case 'h': hFile = optarg; break; case '?': usage(argv[0]); return EXIT_SUCCESS; + case 'v': printf("%s - Built on %s %s\n", PACKAGE_STRING, __DATE__, __TIME__); return EXIT_SUCCESS; default: return usage(argv[0]); } }