summaryrefslogtreecommitdiffstats
path: root/addon/doxmlparser/examples
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2020-12-19 17:42:18 (GMT)
committeralbert-github <albert.tests@gmail.com>2020-12-19 17:42:18 (GMT)
commitb320b14cdfee48a90a732304d6398eb388b1c975 (patch)
tree39c1e152ef11f0885cae4193da40ebc64981fec7 /addon/doxmlparser/examples
parent77a37d141d3603c0089bc4a231c9381c1bb7d707 (diff)
downloadDoxygen-b320b14cdfee48a90a732304d6398eb388b1c975.zip
Doxygen-b320b14cdfee48a90a732304d6398eb388b1c975.tar.gz
Doxygen-b320b14cdfee48a90a732304d6398eb388b1c975.tar.bz2
Usage of version and help in addons
More consequent and consistent usage of help and version in addons.
Diffstat (limited to 'addon/doxmlparser/examples')
-rw-r--r--addon/doxmlparser/examples/metrics/CMakeLists.txt2
-rw-r--r--addon/doxmlparser/examples/metrics/main.cpp21
2 files changed, 21 insertions, 2 deletions
diff --git a/addon/doxmlparser/examples/metrics/CMakeLists.txt b/addon/doxmlparser/examples/metrics/CMakeLists.txt
index 255ae0e..7e99a08 100644
--- a/addon/doxmlparser/examples/metrics/CMakeLists.txt
+++ b/addon/doxmlparser/examples/metrics/CMakeLists.txt
@@ -1,6 +1,7 @@
include_directories(
../../include
+ ${PROJECT_SOURCE_DIR}/libversion
)
add_executable(doxmlparser_metrics
@@ -10,6 +11,7 @@ main.cpp
target_link_libraries(doxmlparser_metrics
doxmlparser
+ doxygen_version
qtools
${COVERAGE_LINKER_FLAGS}
)
diff --git a/addon/doxmlparser/examples/metrics/main.cpp b/addon/doxmlparser/examples/metrics/main.cpp
index 1328abe..9e301b1 100644
--- a/addon/doxmlparser/examples/metrics/main.cpp
+++ b/addon/doxmlparser/examples/metrics/main.cpp
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <string.h>
#include <doxmlintf.h>
+#include "version.h"
bool isDocumented(IDocRoot *brief,IDocRoot *detailed)
{
@@ -49,9 +50,25 @@ bool isDocumented(IDocRoot *brief,IDocRoot *detailed)
int main(int argc,char **argv)
{
- if (argc!=2)
+ int locArgc = argc;
+
+ if (locArgc == 2)
+ {
+ if (!strcmp(argv[1],"--help"))
+ {
+ printf("Usage: %s xml_dir\n",argv[0]);
+ exit(0);
+ }
+ else if (!strcmp(argv[1],"--version"))
+ {
+ printf("%s version: %s\n",argv[0],getFullVersion());
+ exit(0);
+ }
+ }
+
+ if (locArgc!=2)
{
- printf("Usage: %s xml_output_dir\n",argv[0]);
+ printf("Usage: %s xml_dir\n",argv[0]);
exit(1);
}