diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-07-02 14:22:11 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-07-02 14:46:31 -0400 |
commit | 0c6b6035c3318e95e5d417639a3d7854cce72464 (patch) | |
tree | e4312192086078caeebac5ac58f0f32ad3b795df /splitfits.c | |
parent | 5dd87260434756f3c974a6c75d373645d84f7b30 (diff) | |
download | splitfits-0c6b6035c3318e95e5d417639a3d7854cce72464.tar.gz |
Add version information
Diffstat (limited to 'splitfits.c')
-rw-r--r-- | splitfits.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/splitfits.c b/splitfits.c index dd0e6d3..6347c4a 100644 --- a/splitfits.c +++ b/splitfits.c @@ -5,6 +5,7 @@ #include <unistd.h> #include <errno.h> #include <sys/stat.h> +#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; |