From 0c6b6035c3318e95e5d417639a3d7854cce72464 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 2 Jul 2020 14:22:11 -0400 Subject: Add version information --- splitfits.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'splitfits.c') diff --git a/splitfits.c b/splitfits.c index dd0e6d3..6347c4a 100644 --- a/splitfits.c +++ b/splitfits.c @@ -5,6 +5,7 @@ #include #include #include +#include "version.h" #define OP_SPLIT 0 #define OP_COMBINE 1 @@ -486,6 +487,7 @@ void usage(char *program_name) { printf(" -h --help This message\n"); printf(" -c --combine Reconstruct original file using .part_map data\n"); printf(" -o --outdir Path where output files are stored\n"); + printf(" -V --version Display version\n"); } int main(int argc, char *argv[]) { @@ -532,6 +534,10 @@ int main(int argc, char *argv[]) { } else if (strcmp(argv[inputs], "-c") == 0 || strcmp(argv[inputs], "--combine") == 0) { // User wants to reconstruct a FITS file using a .part_map op_mode = OP_COMBINE; + } else if (strcmp(argv[inputs], "-V") == 0 || strcmp(argv[inputs], "--version") == 0) { + // Dump version and exit + puts(SPLITFITS_VERSION); + exit(0); } else { // Arguments beyond this point are considered input file paths break; -- cgit