Skip to content

Commit 1ae9316

Browse files
committed
ENH: Updates to tclap branch 1.4
This is from https://git.code.sf.net/p/tclap/code commit 81b3d2a0c47895c22e9bb8c577f5ab521f76e5d2 branch 1.4 of tclap Make virtual functions calls from constructor explicit. Calling virtual functions from the ctor is safe in C++, but can be confusing. This fixes clang-tidy warnings. Fixes clan-tidy warnings (https://sourceforge.net/p/tclap/patches/18/). Allow const Constraints in constructors Constraints are only used in const-safe ways, so allow a caller to pass a const Constraint. It also allows static construction of constant constraints. Add missing call to check visitor in Unlabeled args. Fixed an error in packaging preventing proper discovery using CMake `find_package` Added packaging using CPack and discovery using pkg-config. Allowed to disable building of examples and unittests. And docs (BUILD_DOC used to have no effect, it is not the case since now.) Remove confusing statement about not supplying flag argument. This is more hurtful than helpful, flag doesn't have to be specified (our docs even have this example), but flag or name does. Fix compilation issue with C++20 and gcc-11.1 Fix some (harmless) warnings from Visual Studio. VS issues warnings for `conversion from 'size_t' to 'int', possible loss of data`. Of course since these are all short strings, it's not an issue - but better to get rid of the warnings so we don't miss anything else. Remove instructions to use cmake --install . --prefix=..., it appears flaky. It doesn't appear to work with my custom doc install targets, they still revert to using the default value of CMAKE_INSTALL_PREFIX (probably because the variable is expanded during configuration, not install phase - but that's a guess). Added docs to install targets. There appears to be no standard way to install docs with CMake, so I've setup paths for win and *NIX to the best of my ability. Include generated docs in release tarball. Also, make sure that release script doesn't have to be run from the top level tclap directory. Explicitly initiailze member variables in init-list. clang-format on unittest files. No functional change. Fixed typos. Fix compilation issue on Windows. Use ptrdiff_t (C++ type) instead of ssize_t (UNIX type). Fix a bug where help output would crash if the program name was 3 chars. https://sourceforge.net/p/tclap/patches/17/ Also added some very basic support for unit tests. We can look at pulling in some more robust unit testing framework later on, but for now keeping it simple to avoid bloat. In addition, consider only platform specific path separators. Script to copy files for release. Make a note that CMake < 3.15 needs plaform specific installer. Clarify that --prefix flag goes on the --install command. --In preparation for release of v1.4. Upload docs for 1.4 to both 1.4 and root. Run clang-format on all files in prep. for 1.4 release. Clean the news file for 1.4 release. Note current maintainer in authors file. Update ChangeLog for 1.4 release. Cleaup manual.xml for 1.4 release candidate. Update Google copyright stansa. Fix compilation error on MacOS operator>> has to be declared before inclusion of Arg.h (CmdLine.h). Update copyright notices and version info. Correct/clarify years and reorder in reverse chronological order in the manual. Added note that this manual is for v1.4 since we'll soon have two versions "live". HTML manual is now built by cmake, no need to maintain it manually. Make a note of it, and remove the checked in generated file. Add example for how to use a pair as a custom type. https://sourceforge.net/p/tclap/support-requests/2/ Update generated documentation for 1.4. Echo commands from upload script. To avoid myself getting confused when the right $USER is not set. Add documentation for ExitException. Looks like it may be useful for some users to catch this instead of having TCLAP terminate the program. Also clarify that ArgException doesn't catch *any* exception. https://sourceforge.net/p/tclap/bugs/29/ Add missing expected test output from [96fd5ea]. Add some generated file types to gitignore (and sort it). Check arguments vector is not empty before accessing first element. Some users use TCLAP to parse messages sent between long-running programs by puting arguments in a std::vector<std::string> and use CmdLine::parse to parse it. Passing an empty vector to parse results in a segmentation violation (due to the fact that we always expect to be able to pop the first element). Change the behaviour to throw a more user friendly error message. https://sourceforge.net/p/tclap/bugs/30/ Revert dd2c7b6faa13ad74bce2bfe26e5483e62186ed6c that was pushed upstream by mistake. Don't catch exceptions by value. Exceptions are polymorphic, catching by value may loose information. fix sign-conversion warnings ENH: Adding travis build enviornment for CI testing CI integration for many common platforms. - Unix based platforms included - Many common unix compilers included Allow travis building of all branches ENH: Adding my.cdash.org reporting site for testing. To generate a report of the build & testing environment. ``` mkdir -p tclap-code-build cd tclap-code-build cmake ../tclap-code make Experimental # or ninja Experimental or ... ``` Then open https://my.cdash.org/index.php?project=tclap to see the resulting report. ENH: Explicitly add LANGUAGES CXX for project. STYLE: Convert CMake-language commands to lower case Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. STYLE: Remove CMake-language block-end command arguments Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. ENH: enable_testing at top level You need to move the enable_testing() call to be before you do add_subdirectory(tests). https://stackoverflow.com/questions/30250494/ctest-not-detecting-tests Clean up handling of locally allocated objects. 1) Just keep a default StdOutput around so we don't have to track if it was set by user. 2) Generalize handling of deleting allocated objects when CmdLine is destroyed. Updated TODOs Cleanup some simple setters. Inline into the class if they are only one line and make them const whenever possible.
1 parent 087c020 commit 1ae9316

File tree

308 files changed

+4637
-18285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+4637
-18285
lines changed

tclap/.clang-format

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: Google
4+
AccessModifierOffset: -4
5+
AlignAfterOpenBracket: true
6+
AlignEscapedNewlinesLeft: true
7+
AlignOperands: true
8+
AlignTrailingComments: true
9+
AllowAllParametersOfDeclarationOnNextLine: true
10+
AllowShortBlocksOnASingleLine: false
11+
AllowShortCaseLabelsOnASingleLine: false
12+
AllowShortIfStatementsOnASingleLine: true
13+
AllowShortLoopsOnASingleLine: true
14+
AllowShortFunctionsOnASingleLine: All
15+
AlwaysBreakAfterDefinitionReturnType: false
16+
AlwaysBreakTemplateDeclarations: true
17+
AlwaysBreakBeforeMultilineStrings: true
18+
BreakBeforeBinaryOperators: None
19+
BreakBeforeTernaryOperators: true
20+
BreakConstructorInitializersBeforeComma: false
21+
BinPackParameters: true
22+
BinPackArguments: true
23+
ColumnLimit: 80
24+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
25+
ConstructorInitializerIndentWidth: 4
26+
DerivePointerAlignment: false
27+
ExperimentalAutoDetectBinPacking: false
28+
IndentCaseLabels: true
29+
IndentWrappedFunctionNames: false
30+
IndentFunctionDeclarationAfterType: false
31+
MaxEmptyLinesToKeep: 1
32+
KeepEmptyLinesAtTheStartOfBlocks: false
33+
NamespaceIndentation: None
34+
ObjCBlockIndentWidth: 4
35+
ObjCSpaceAfterProperty: false
36+
ObjCSpaceBeforeProtocolList: false
37+
PenaltyBreakBeforeFirstCallParameter: 1
38+
PenaltyBreakComment: 300
39+
PenaltyBreakString: 1000
40+
PenaltyBreakFirstLessLess: 120
41+
PenaltyExcessCharacter: 1000000
42+
PenaltyReturnTypeOnItsOwnLine: 200
43+
PointerAlignment: Right
44+
SpacesBeforeTrailingComments: 2
45+
Cpp11BracedListStyle: true
46+
Standard: Auto
47+
IndentWidth: 4
48+
TabWidth: 4
49+
UseTab: Never
50+
BreakBeforeBraces: Attach
51+
SpacesInParentheses: false
52+
SpacesInSquareBrackets: false
53+
SpacesInAngles: false
54+
SpaceInEmptyParentheses: false
55+
SpacesInCStyleCastParentheses: false
56+
SpaceAfterCStyleCast: false
57+
SpacesInContainerLiterals: true
58+
SpaceBeforeAssignmentOperators: true
59+
ContinuationIndentWidth: 4
60+
CommentPragmas: '^ IWYU pragma:'
61+
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
62+
SpaceBeforeParens: ControlStatements
63+
DisableFormat: false
64+
...
65+

tclap/.gitignore

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
1-
*.gcno
1+
*#
22
*.gcda
3+
*.gcno
4+
*.in
35
*.o
6+
*.orig
7+
*.patch
8+
*.pyc
49
*~
5-
*#
6-
*.in
7-
cov/
10+
.vs/
11+
Makefile
812
aclocal.m4
913
autom4te.cache/
14+
build/
1015
config.log
1116
config.status
1217
config/Makefile
1318
config/Makefile.in
1419
config/config.h*
1520
config/stamp-h1
21+
config/test-driver
1622
configure
23+
cov/
1724
docs/Doxyfile
1825
docs/html/
1926
examples/.deps/
20-
examples/test[0-9][0-9]
2127
examples/test[0-9]
22-
Makefile
28+
examples/test[0-9][0-9]
29+
inst/
2330
tclap.pc
24-
config/test-driver
25-
tests/tmp.out
2631
tests/test*.log
2732
tests/test*.trs
33+
tests/tmp.out

tclap/.travis.yml

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
language: cpp
2+
cache:
3+
- ccache
4+
- directories:
5+
- externalobjects
6+
- $HOME/Library/Caches/Homebrew
7+
- /usr/local/Homebrew
8+
dist: bionic
9+
10+
git:
11+
depth: false
12+
13+
# Only build the master branch, and pull-requests.
14+
# This turns off commit builds to other branches
15+
# branches:
16+
# only:
17+
# - master
18+
19+
before_cache:
20+
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi
21+
# Credit https://discourse.brew.sh/t/best-practice-for-homebrew-on-travis-brew-update-is-5min-to-build-time/5215/9
22+
# Cache only .git files under "/usr/local/Homebrew" so "brew update" does not take 5min every build
23+
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then find /usr/local/Homebrew \! -regex ".+\.git.+" -delete; fi
24+
25+
addons:
26+
apt:
27+
sources:
28+
- sourceline: 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic main'
29+
key_url: 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x60C317803A41BA51845E371A1E9377A2BA9EF27F'
30+
- sourceline: 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/ppa/ubuntu bionic main'
31+
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-5.0 main'
32+
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
33+
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-6.0 main'
34+
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-7 main'
35+
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main'
36+
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
37+
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main'
38+
- sourceline: 'deb https://apt.kitware.com/ubuntu/ bionic main'
39+
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
40+
- sourceline: 'deb http://ppa.launchpad.net/jonathonf/gcc/ubuntu bionic main'
41+
key_url: 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x4AB0F789CBA31744CC7DA76A8CF63AD3F06FC659'
42+
packages:
43+
- cmake
44+
- ninja-build
45+
- g++-4.8
46+
- g++-5
47+
- g++-6
48+
- g++-7
49+
- g++-8
50+
- g++-9
51+
- gcc-4.8
52+
- gcc-5
53+
- gcc-6
54+
- gcc-7
55+
- gcc-8
56+
- gcc-9
57+
- clang-3.9
58+
- clang-4.0
59+
- clang-5.0
60+
- clang-6.0
61+
- clang-7
62+
- clang-8
63+
- clang-9
64+
65+
matrix:
66+
include:
67+
- os: linux
68+
env:
69+
- MATRIX_EVAL="export CC=gcc-4.8 CXX=g++-4.8"
70+
- os: linux
71+
env:
72+
- MATRIX_EVAL="export CC=gcc-5 CXX=g++-5"
73+
- os: linux
74+
env:
75+
- MATRIX_EVAL="export CC=gcc-6 CXX=g++-6"
76+
- os: linux
77+
env:
78+
- MATRIX_EVAL="export CC=gcc-7 CXX=g++-7"
79+
- os: linux
80+
env:
81+
- MATRIX_EVAL="export CC=gcc-8 CXX=g++-8"
82+
- os: linux
83+
env:
84+
- MATRIX_EVAL="export CC=gcc-9 CXX=g++-9"
85+
#Linux Clang Starts Here
86+
- os: linux
87+
env:
88+
- MATRIX_EVAL="export CC=clang-3.9 CXX=clang++-3.9"
89+
- os: linux
90+
env:
91+
- MATRIX_EVAL="export CC=clang-4.0 CXX=clang++-4.0"
92+
- os: linux
93+
env:
94+
- MATRIX_EVAL="export CC=clang-5.0 CXX=clang++-5.0"
95+
- os: linux
96+
env:
97+
- MATRIX_EVAL="export CC=clang-6.0 CXX=clang++-6.0"
98+
- os: linux
99+
env:
100+
- MATRIX_EVAL="export CC=clang-7 CXX=clang++-7"
101+
- os: linux
102+
env:
103+
- MATRIX_EVAL="export CC=clang-8 CXX=clang++-8"
104+
- os: linux
105+
env:
106+
- MATRIX_EVAL="export CC=clang-9 CXX=clang++-9"
107+
#OSX GCC Starts here
108+
- os: osx
109+
osx_image: xcode11.3
110+
env:
111+
- MATRIX_EVAL="export CC=gcc-6 CXX=g++-6"
112+
addons:
113+
homebrew:
114+
packages:
115+
- cmake
116+
- ccache
117+
- ninja
118+
- python
119+
- gcc@6
120+
update: yes
121+
- os: osx
122+
osx_image: xcode11.3
123+
env:
124+
- MATRIX_EVAL="export CC=gcc-7 CXX=g++-7"
125+
addons:
126+
homebrew:
127+
packages:
128+
- cmake
129+
- ccache
130+
- ninja
131+
- python
132+
- gcc@7
133+
update: yes
134+
- os: osx
135+
osx_image: xcode11.3
136+
env:
137+
- MATRIX_EVAL="export CC=gcc-8 CXX=g++-8"
138+
addons:
139+
homebrew:
140+
packages:
141+
- cmake
142+
- ccache
143+
- ninja
144+
- python
145+
- gcc@8
146+
update: yes
147+
- os: osx
148+
osx_image: xcode11.3
149+
env:
150+
- MATRIX_EVAL="export CC=gcc-9 CXX=g++-9"
151+
addons:
152+
homebrew:
153+
packages:
154+
- cmake
155+
- ccache
156+
- ninja
157+
- python
158+
- gcc@9
159+
update: yes
160+
#OSX clang starts here
161+
- os: osx
162+
osx_image: xcode11.3
163+
env:
164+
- MATRIX_EVAL="export CC=clang CXX=clang++"
165+
addons:
166+
homebrew:
167+
packages:
168+
- cmake
169+
- ccache
170+
- ninja
171+
- python
172+
update: yes
173+
174+
before_install:
175+
- eval "${MATRIX_EVAL}"
176+
177+
script:
178+
# NOTE: ${TRAVIS_BUILD_DIR} is actually the source checkout directory ${TRAVIS_BUILD_DIR}/build is the BUILD_DIR
179+
- mkdir -p ${TRAVIS_BUILD_DIR}/build && cd ${TRAVIS_BUILD_DIR}/build
180+
- "export PATH=\"$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}')\""
181+
- cd ${TRAVIS_BUILD_DIR}/build && cmake -GNinja -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_DOC:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DCMAKE_BUILD_TYPE:STRING=Release ${TRAVIS_BUILD_DIR}
182+
- cd ${TRAVIS_BUILD_DIR}/build && ctest -D Experimental -j2

tclap/AUTHORS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
original author: Michael E. Smoot
3-
invaluable contributions: Daniel Aarno
3+
current maintainer: Daniel Aarno
44
more contributions: Erik Zeek
55
more contributions: Fabien Carmagnac (Tinbergen-AM)
66
outstanding editing: Carol Smoot

0 commit comments

Comments
 (0)