# [footer]
# //////////////////////////////////////////////////////////////////////////////
# [title.type]
# Must be one of the following:
# - fix: Commits that fix bugs
# - feat: Commits that add new features
# - refactor: Commits that change existing code without changing any behavior
# - perf: Special refactor commits that improve performance
# - style: Commits that do not affect meaning (white-space, formatting, etc.)
# - test: Commits that add tests or fixing existing tests
# - docs: Commits that affect documentation only
# - build: Commits that change build components (scripts, CI pipeline, etc.)
# - chore: Miscellaneous commits (modifying .gitignore, etc.)
# - tag: Commits for adding tags
#
# [title.scope]
# The scope should be the name of the npm package affected. The following is
# the list of supported scopes:
# - xa: XAgent (default)
# - usi: Unified Storage Interface
# - uls: Unified Log System
#
# [title.summary]
# Use the summary field to provide a succinct description of the change:
# - Use the imperative, present tense: "change" not "changed" nor "changes"
# - Don't capitalize the first letter
# - No period (.) at the end
#
# [body]
# Just as in the summary, use the imperative, present tense: "fix" not "fixed"
# nor "fixes".
#
# Explain the motivation for the change in the commit message body. This commit
# message should explain why you are making the change. You can include a
# comparison of the previous behavior with the new behavior in order to
# illustrate the impact of the change.
#
# [footer]
# The footer can contain information about breaking changes and deprecations
# and is also the place to reference GitHub issues, JIRA tickets, and other PRs
# that this commit closes or is related to. For example:
#
# Resolves XCAGENT-100
# Resolves XCAGENT-100, SEAL-1500, XCAGENT-512
#
# BREAKING CHANGE: <breaking change summary>
# <BLANK LINE>
# <breaking change description + migration instructions>
# <BLANK LINE>
# <BLANK LINE>
# Resolves <JIRA ticket>
#
# DEPRECATED: <what is deprecated>
# <BLANK LINE>
# <deprecation description + recommended update path>
# <BLANK LINE>
# <BLANK LINE>
# Resolves #<JIRA ticket>
Currently CMake scripts will generate both dynamic and static libraries
at the same time. However, CMake recommends using BUILD_SHARED_LIBS to
build either dynamic or static library, which is enforced by vcpkg.
Use BUILD_SHARED_LIBS to build one library type at a time, so that
developers can use vcpkg manifest mechanism to install Argtable3.
We also add namespace (argtable3::) to the package and generate CMake
config version file (Argtable3ConfigVersion.cmake), which can be used to determine the library version in find_package().
Add a CMake setting ARGTABLE3_LONG_ONLY to use getopt_long_only in
dynamic and static libraries. By default it is OFF. To turn on the
setting:
$ cmake -DARGTABLE3_LONG_ONLY=ON ..
Add a C macro ARG_LONG_ONLY to use getopt_long_only in ordinary source
distribution and amalgamation distribution.
resolves#57
Switching to FreeBSD getopt library can resolve two issues:
1. FreeBSD getopt always uses the 2-Clause BSD, which is compatible
to GPL. (Although NetBSD has switched to the 2-Clause BSD in
2008.)
2. FreeBSD getopt_long provides getopt_long_only, which is critical
for developers who want to follow the command-line syntax
convention, which uses a single '-' character for long options.
resolves: #54#56
We didn't notice that using add_compile_definitions will force
developers upgrading their CMake to 3.12. Go back using the old
add_definitions() so we can keep using CMake 3.0.
resolves: #48
When we build with AddressSanitizer (ASan) in GCC, we can see a lot of memory
leaks and a buffer overflow issue in unit tests and arg_file implementation.
The root cause of memory leaks in unit tests is that, we never care about
releasing memory in unit test code. Besides, the semantics of CuSuiteAddSuite()
makes releasing a test suite very difficult. By fixing CuSuiteAddSuite() and
carefully releasing memory in unit tests, memory leaks are resolved.
The root cause of the buffer overflow issue in arg_file is that, we mix pointer
and array operations together. By using strlen(result) instead of result[1] to
determine the string length, the buffer overflow issue is resolved.
resolves: #46
With the new CMake script, we can generate four types of library:
shared, static, original source, and amalgamation source. We add tests
to make sure all library types can work correctly.
We've also solved several issues related to Linux/Windows build errors.
The CMake script can generate the amalgamation distribution, and we can
choose whether to use the amalgamation or not.
This is a huge commit since the last one. Here are the major changes:
- Add original source files and the amalgamation generator utilities
- Add dynamic string utilities (arg_dstr) used to generator output
- Add hash table utilities (arg_hashtable) used to store sub-commands
- Add utilities (arg_cmd) used to implement the sub-command mechanism
- Use clang-format to unify the coding style
- Add new unit tests
- Fix warnings under strict compiler settings in VC and GCC
- Add ARG_REPLACE_GETOPT to choose the built-in or system getopt
- Add utilities to generate help messages
- Cleanup the mess after various pull requests