diff options
author | albert-github <albert.tests@gmail.com> | 2020-12-19 17:42:18 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2020-12-19 17:42:18 (GMT) |
commit | b320b14cdfee48a90a732304d6398eb388b1c975 (patch) | |
tree | 39c1e152ef11f0885cae4193da40ebc64981fec7 /addon/doxmlparser | |
parent | 77a37d141d3603c0089bc4a231c9381c1bb7d707 (diff) | |
download | Doxygen-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')
-rw-r--r-- | addon/doxmlparser/examples/metrics/CMakeLists.txt | 2 | ||||
-rw-r--r-- | addon/doxmlparser/examples/metrics/main.cpp | 21 | ||||
-rw-r--r-- | addon/doxmlparser/test/CMakeLists.txt | 2 | ||||
-rw-r--r-- | addon/doxmlparser/test/main.cpp | 21 |
4 files changed, 42 insertions, 4 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); } diff --git a/addon/doxmlparser/test/CMakeLists.txt b/addon/doxmlparser/test/CMakeLists.txt index 7cdeda6..4caef57 100644 --- a/addon/doxmlparser/test/CMakeLists.txt +++ b/addon/doxmlparser/test/CMakeLists.txt @@ -1,6 +1,7 @@ include_directories( ../include + ${PROJECT_SOURCE_DIR}/libversion ${PROJECT_SOURCE_DIR}/qtools ) @@ -11,6 +12,7 @@ main.cpp target_link_libraries(doxmlparser_test doxmlparser + doxygen_version qtools ${COVERAGE_LINKER_FLAGS} ) diff --git a/addon/doxmlparser/test/main.cpp b/addon/doxmlparser/test/main.cpp index 0d1f95e..35fd700 100644 --- a/addon/doxmlparser/test/main.cpp +++ b/addon/doxmlparser/test/main.cpp @@ -17,6 +17,7 @@ #include <stdlib.h> #include <doxmlintf.h> #include <qstring.h> +#include "version.h" /*! Dumps the contents of a hyperlinked text fragment as plain text to the * output. @@ -577,9 +578,25 @@ void DumpParamList(IParamIterator *pli,int indent) 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 xmldir\n",argv[0]); + printf("Usage: %s xml_dir\n",argv[0]); exit(1); } |