Releases: seqan/sharg-parser
Sharg 1.2.1
Sharg 1.2.0
Features
- Recursive subcommands: Subcommands can now have their own subcommands, allowing for more complex command-line interfaces (e.g.,
git remote add) (#233). - Auto-generated synopsis: The synopsis line shown in help pages is now automatically generated based on the configured options and flags. A synopsis is only generated if no synopsis is given. You can deactivate this by setting
parser.info.synopsis = {""};(#296). - Subparser metadata propagation: Some metadata (e.g.,
version,app_name) is now automatically copied to subparsers (#285). - Multiple citations: Applications can now specify multiple citations instead of just one (#280).
sharg::parser_meta_datanow supports designated initializers (#285).
Bug fixes
- Fixed
is_option_set()to correctly match both long and short option identifiers (#226). - Fixed an issue where having multiple flags refering to the same
bool value(add_flag(value, ...);) resulted in not settingvaluetotrue(#243). - Fixed CWL/CTD export to correctly mark positional options as required (positional list options remain optional) (#237).
- Fixed man page export to use lowercase application name (#296).
API changes
Compiler
- We now use C++23.
- Compiler support (tested):
- GCC 13, 14, 15
- Clang 19, 20, 21
- Intel oneAPI C++ Compiler 2025.0 (IntelLLVM)
- Other compilers might work but are not tested, GCC < 12 and Clang < 17 are known to not work.
Dependencies
- We now use Doxygen version 1.10.0 to build our documentation (#230).
- Switched from git submodules to CPM (CMake Package Manager) for dependency management (#260).
Notes for package maintainers
Click to expand
For reference, you can have a look at the seqan3 Debian package.
Dependencies
Dependencies are listed in cmake/package-lock.cmake.
We now use CPM for dependency management.
To use locally installed packages, pass -DCPM_USE_LOCAL_PACKAGES=ON to cmake, or set the environment variable CPM_USE_LOCAL_PACKAGES to ON. CPM documentation
If your locally installed package has an older version, you may need to additionally pass the version to cmake.
The version variables can be found in cmake/package-lock.cmake.
For example, let's assume your googletest version is 1.14.0 instead of 1.15.2 listed in the package-lock.cmake.
CPM (or rather CMake's find_package) would not use your local version because 1.14.0 < 1.15.2.
Passing -DSHARG_GOOGLETEST_VERSION=1.14.0 to CMake will result in your local package being used.
If your local package version is newer, it should be used without any additional CMake arguments.
What's Changed
Click to expand
- [INFRA] Bump version by @eseiler in #205
- [DOC] Use doxygen-awesome by @eseiler in #206
- Bump actions/checkout from 3 to 4 by @dependabot[bot] in #208
- Bump crazy-max/ghaction-import-gpg from 5 to 6 by @dependabot[bot] in #207
- Bump Pendect/action-rsyncer from 1.1.0 to 2.0.0 by @dependabot[bot] in #209
- Bump peter-evans/create-or-update-comment from 2 to 3 by @dependabot[bot] in #210
- patch: using newest TDL by @SGSSGene in #211
- [INFRA] CMake: Remove unused dependencies by @eseiler in #212
- [INFRA] Add stdlibc++ CI by @eseiler in #213
- Bump actions/setup-python from 4 to 5 by @dependabot[bot] in #214
- Bump actions/cache from 3 to 4 by @dependabot[bot] in #215
- Bump peter-evans/create-or-update-comment from 3 to 4 by @dependabot[bot] in #216
- [INFRA] Optional tdl by @eseiler in #218
- [INFRA] Do not use TDL in header tests by @eseiler in #223
- [INFRA] Add codecov token by @eseiler in #227
- [MISC] Add quotes to strings by @eseiler in #224
- [MISC] SPDX license header by @eseiler in #229
- [INFRA] Update doxygen by @eseiler in #230
- [DOC] Fix version selector by @eseiler in #231
- [INFRA] Update TDL by @eseiler in #235
- [MISC] Use vector for arguments by @eseiler in #239
- [FIX] CWL: positional options by @eseiler in #237
- [MISC] Check that parse was not called by @eseiler in #240
- [INFRA] Update TDL by @eseiler in #241
- [TEST] Use a test fixture by @eseiler in #242
- [FIX] flags setting value to false by @eseiler in #243
- [MISC] Defer everything to parse() by @eseiler in #238
- [TEST] Add EXPECT_THROW_MSG by @eseiler in #245
- Bump fsfe/reuse-action from 2 to 3 by @dependabot[bot] in #246
- [FIX,DOC] Doxygen workaround by @eseiler in #248
- [MISC] Allow options for subcommands by @eseiler in #244
- [INFRA,TEST] API patches by @eseiler in #251
- Bump fsfe/reuse-action from 3 to 4 by @dependabot[bot] in #252
- [INFRA] Update TDL by @eseiler in #253
- [INFRA] Update TDL by @eseiler in #254
- [DOC] Update version selector by @eseiler in #255
- [MISC] Allow recursive subcommands by @eseiler in #233
- Bump fsfe/reuse-action from 4 to 5 by @dependabot[bot] in #256
- [INFRA] Update CI by @eseiler in #257
- [INFRA] Set default for SHARG_VERBOSE_TESTS to OFF by @eseiler in #259
- [FIX] Version check URL by @eseiler in #258
- [INFRA] Use CPM by @eseiler in #260
- [INFRA] Update CPM Packages by @seqan-actions in #261
- [FIX] Do not find_package yourself by @eseiler in #262
- [INFRA] Bump CMake by @eseiler in #263
- [INFRA] Update CPM Packages by @seqan-actions in #264
- [INFRA] Update CPM Packages by @seqan-actions in #265
- [INFRA] Update config, use cpp23 by @eseiler in #266
- [INFRA] Add CodeChecker and CodeQL by @eseiler in #267
- [FIX] some codechecker reports by @eseiler in #268
- [FIX] More codechecker checks by @eseiler in #269
- [FIX] gcc15: Workaround bogus warning by @eseiler in #270
- [FIX] gcc15: Workaround bogus warning 2nd try by @eseiler in #271
- [INFRA] Update codechecker by @eseiler in #272
- [FIX] is_option_set: match both long and short ids by @eseiler in #226
- [FIX,TEST] API by @eseiler in #273
- [INFRA] Update CPM Packages by @seqan-actions in #274
- [INFRA] Update CPM Packages by @seqan-actions in #275
- [INFRA] Update CPM Packages by @seqan-actions in #276
- [INFRA] Update CI by @eseiler in #277
- [MISC] Copyright, Link Check by @eseiler in https://github.com/seqan/sharg-parser...
Sharg 1.2.0-rc.1
What's Changed
- [INFRA] Bump version by @eseiler in #205
- [DOC] Use doxygen-awesome by @eseiler in #206
- patch: using newest TDL by @SGSSGene in #211
- [INFRA] CMake: Remove unused dependencies by @eseiler in #212
- [INFRA] Add stdlibc++ CI by @eseiler in #213
- [INFRA] Optional tdl by @eseiler in #218
- [INFRA] Do not use TDL in header tests by @eseiler in #223
- [INFRA] Add codecov token by @eseiler in #227
- [MISC] Add quotes to strings by @eseiler in #224
- [MISC] SPDX license header by @eseiler in #229
- [INFRA] Update doxygen by @eseiler in #230
- [DOC] Fix version selector by @eseiler in #231
- [INFRA] Update TDL by @eseiler in #235
- [MISC] Use vector for arguments by @eseiler in #239
- [FIX] CWL: positional options by @eseiler in #237
- [MISC] Check that parse was not called by @eseiler in #240
- [INFRA] Update TDL by @eseiler in #241
- [TEST] Use a test fixture by @eseiler in #242
- [FIX] flags setting value to false by @eseiler in #243
- [MISC] Defer everything to parse() by @eseiler in #238
- [TEST] Add EXPECT_THROW_MSG by @eseiler in #245
- [FIX,DOC] Doxygen workaround by @eseiler in #248
- [MISC] Allow options for subcommands by @eseiler in #244
- [INFRA,TEST] API patches by @eseiler in #251
- [INFRA] Update TDL by @eseiler in #253
- [INFRA] Update TDL by @eseiler in #254
- [DOC] Update version selector by @eseiler in #255
- [MISC] Allow recursive subcommands by @eseiler in #233
- [INFRA] Update CI by @eseiler in #257
- [INFRA] Set default for SHARG_VERBOSE_TESTS to OFF by @eseiler in #259
- [FIX] Version check URL by @eseiler in #258
- [INFRA] Use CPM by @eseiler in #260
- [FIX] Do not find_package yourself by @eseiler in #262
- [INFRA] Bump CMake by @eseiler in #263
- [INFRA] Update config, use cpp23 by @eseiler in #266
- [INFRA] Add CodeChecker and CodeQL by @eseiler in #267
- [FIX] some codechecker reports by @eseiler in #268
- [FIX] More codechecker checks by @eseiler in #269
- [FIX] gcc15: Workaround bogus warning by @eseiler in #270
- [FIX] gcc15: Workaround bogus warning 2nd try by @eseiler in #271
- [INFRA] Update codechecker by @eseiler in #272
- [FIX] is_option_set: match both long and short ids by @eseiler in #226
- [FIX,TEST] API by @eseiler in #273
- [INFRA] Update CI by @eseiler in #277
- [MISC] Copyright, Link Check by @eseiler in #278
Full Changelog: 1.1.1...1.2.0-rc.1
Sharg 1.1.1
We are happy to release a new patch version of Sharg.
The release includes a few minor changes:
Bug fixes
- Fixed installation of Sharg via
make install(#202).
API changes
Compiler
- Dropped support for gcc-10 (#199).
- Added support for gcc-13 (#199).
- Added support for clang-17 (#197, #198).
Check out our API documentation or learn how to use Sharg with our Tutorials and How-Tos.
Sharg 1.1.1-rc.1
Sharg 1.1.0
We are happy to release a new minor version of Sharg.
The release includes a few minor fixes and adds support for Gitpod and CWL (via --export-help cwl).
For detailed information, see the Changelog.
Check out our API documentation or learn how to use Sharg with our Tutorials and How-Tos.
Sharg 1.0.0
We are thrilled to announce the first Sharg parser release: 1.0.0
With most of the API being stable!
We have outsourced the SeqAn3 Argument Parser to its own light-weight, dependency-free repository: The Sharg parser.
Most of the API stayed similar. We added a new, flexible config design for adding options and flags, improving readability and maintainability. Not unexpectedly, we have some changes in namespace and naming:
The former seqan3::argument_parser is now the sharg::parser
If you have any trouble porting your code from SeqAn3 to the Sharg parser, please don't hesitate to reach out to us on GitHub or !
- Get to know the Sharg parser with our tutorials.
- Visit our API documentation.
- Check out our Sharg Cookbook. It contains a listing of code examples on how to perform particular tasks using the library.
While we will present essential changes compared to the seqan3::argument_parser in this message, you can also find a comprehensive list of the changes in our changelog.
🎉 New Features
The new sharg::config design
An option flag or positional option is added with only two parameters:
- A value that stores the command line parameter (nothing changed here)
- A
sharg::configobject (NEW)
Before:
parser.add_option(val, 'i', "int", "some int");Now:
parser.add_option(val, sharg::config{.short_id = 'i',
.long_id = "int",
.description = "some int"});Although it is a little longer, it is easier to understand, more flexible and future-proof.
We take advantage of Designated initializers. E.g., you can leave out parameters you don't need, but beware that the order must be as specified in sharg::config.
You can now set an option as required without the need of the sharg::option_spec
parser.add_option(val, sharg::config{.short_id = 'i', .required = true});Alter the default message
You can now alter the default message printed on the help page. E.g.
int i{};
parser.add_option(val, sharg::config{.short_id = 'i', .default_message = "Calculated from your data"});Instead of Default: 0., it prints
-i (signed 32 bit integer)
Default: Calculated from your data.
🛠️ Notable API changes
Name changes
If you are switching from the seqan3::argument_parser to the sharg::parser, there are several name changes. All of them can be fixed with a simple search & replace:
- The namespace of all entities is now
sharginstead ofseqan3 - Every occurrence of
argument_parserhas been replaced withparser - The concept
seqan::parser_compatible_optionhas been renamed tosharg::parsable
The new sharg::config design
The new config design is also an API break because we do not support the former calls from the seqan3::argument_parser.
We removed the sharg::option_spec as it is obsolete in the new API.
Validators
To avoid being dependent on the SeqAn3 I/O module, you now have to give a list of file extensions explicitly to sharg::input_file_validator and sharg::output_file_validator:
sharg::input_file_validator validator{std::vector<std::string>{{"exe"}, {"fasta"}}};Please follow the SeqAn3 issue to see how the file extensions can be extracted from SeqAn3 files.
🔌 Tooling
- Sharg 1.0.0 is known to compile with GCC 10.4, 11.3, and 12.2. Future versions might work, but were not yet available at the time of this release.
- Other compilers, e.g., clang, and MSVC, have not been tested yet with Sharg 1.0.0.
- We use doxygen 1.9.4 to build our documentation.