diff options
author | Timo Weingärtner <timo@tiwe.de> | 2012-02-03 14:33:21 +0100 |
---|---|---|
committer | Timo Weingärtner <timo@tiwe.de> | 2012-02-15 02:07:51 +0100 |
commit | 27b8fc1395bece0dc309512a3790a4892e0d29b1 (patch) | |
tree | 355770e76754b9029c606469522cf0b56d08a976 /hadori.C | |
parent | 894df89979fdd604588eae999f984b05e471ceb8 (diff) | |
download | hadori-27b8fc1395bece0dc309512a3790a4892e0d29b1.tar.gz |
Add --version, generate version.h from git, clean manpage
Diffstat (limited to 'hadori.C')
-rw-r--r-- | hadori.C | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -36,6 +36,7 @@ namespace po = boost::program_options; #include <sysexits.h> #include "inode.h" +#include "version.h" // needed for equal_range and range-for namespace std { @@ -187,6 +188,7 @@ int main (int const argc, char ** argv) { po::options_description opts("OPTIONS"); opts.add_options() ("help,h", "print this help message") + ("version,V", "print version information") ("no-time,t", "ignore mtime") ("hash", "use adler32 hash to speed up comparing many files with same size and mostly identical content") ("dry-run,n", "don't change anything, implies --verbose") @@ -211,6 +213,11 @@ int main (int const argc, char ** argv) { return EX_OK; } + if (config.count("version")) { + std::cout << HADORI_VERSION << std::endl; + return EX_OK; + } + if (not config.count("debug")) debug.rdbuf(nullptr); if (not config.count("debug") and not config.count("verbose") and not config.count("dry-run")) |