From ce56750e8a47e3be86cf0c0964a145c7d7f943e5 Mon Sep 17 00:00:00 2001 From: Torgny Nyblom Date: Sat, 4 Dec 2010 20:53:43 +0100 Subject: Add an option to print some stats after a run. --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index ad6cde3..d6a5a6b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -105,6 +105,7 @@ static const CommandLineOption options[] = { {"--dry-run", "don't actually write anything"}, {"--debug-rules", "print what rule is being used for each file"}, {"--commit-interval NUMBER", "if passed the cache will be flushed to git every NUMBER of commits"}, + {"--stats", "after a run print some statistics about the rules"}, {"-h, --help", "show help"}, {"-v, --version", "show version"}, CommandLineLastOption @@ -113,6 +114,7 @@ static const CommandLineOption options[] = { int main(int argc, char **argv) { CommandLineParser::init(argc, argv); + Stats::init(); CommandLineParser::addOptionDefinitions(options); CommandLineParser *args = CommandLineParser::instance(); if (args->contains(QLatin1String("help")) || args->arguments().count() != 1) { @@ -230,6 +232,6 @@ int main(int argc, char **argv) repo->finalizeTags(); delete repo; } - + Stats::instance()->printStats(); return errors ? EXIT_FAILURE : EXIT_SUCCESS; } -- cgit v1.2.1