diff options
author | 2022-01-03 13:20:42 -0500 | |
---|---|---|
committer | 2022-01-04 05:20:42 +1100 | |
commit | 84236b7f7c6ca29721798c2431e92713eabfdec5 (patch) | |
tree | 32c098fac4cf446bb10f1cf2dec01a99b0608667 /src/tools/floptool.cpp | |
parent | 7d56d3a70bd1384765af452f20a2655e6071d48f (diff) |
Added a 'version' verb to floptool (#9079)
Diffstat (limited to 'src/tools/floptool.cpp')
-rw-r--r-- | src/tools/floptool.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tools/floptool.cpp b/src/tools/floptool.cpp index b69c3fe1881..9632fe4eeca 100644 --- a/src/tools/floptool.cpp +++ b/src/tools/floptool.cpp @@ -35,6 +35,7 @@ static void display_usage() fprintf(stderr, " floptool.exe flopdir input_format filesystem <image> -- List the contents of a floppy image\n"); fprintf(stderr, " floptool.exe flopread input_format filesystem <image> <path> <outputfile> -- Extract a file from a floppy image\n"); fprintf(stderr, " floptool.exe flopwrite input_format filesystem <image> <inputfile> <path> -- Write a file into a floppy image\n"); + fprintf(stderr, " floptool.exe version -- Display the current version of floptool\n"); } static void display_formats() @@ -675,6 +676,13 @@ static int hdwrite(int argc, char *argv[]) return generic_write(ih, argv[4], argv[5]); } +static int version(int argc, char *argv[]) +{ + extern const char build_version[]; + fprintf(stdout, "%s\n", build_version); + return 0; +} + int CLIB_DECL main(int argc, char *argv[]) { formats.init(); @@ -703,6 +711,8 @@ int CLIB_DECL main(int argc, char *argv[]) return hdread(argc, argv); else if(!core_stricmp("hdwrite", argv[1])) return hdwrite(argc, argv); + else if (!core_stricmp("version", argv[1])) + return version(argc, argv); else { fprintf(stderr, "Unknown command '%s'\n\n", argv[1]); display_usage(); |