Skip to content

Releases: seqan/sharg-parser

Sharg 1.2.1

18 Jan 18:18
1.2.1
fb91442

Choose a tag to compare

GitHub commits since tagged version (branch)

This maintenance release resolves a few issues with CPM and a missing update of the TDL library.

What's Changed

Full Changelog: 1.2.0...1.2.1

Sharg 1.2.0

15 Jan 19:16
1.2.0
015cacc

Choose a tag to compare

GitHub commits since tagged version (branch)

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_data now 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 setting value to true (#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
Read more

Sharg 1.2.0-rc.1

29 Jul 13:50
1.2.0-rc.1
3851107

Choose a tag to compare

Sharg 1.2.0-rc.1 Pre-release
Pre-release

GitHub commits since tagged version (branch)

What's Changed

Full Changelog: 1.1.1...1.2.0-rc.1

Sharg 1.1.1

08 Aug 13:56
1.1.1
710d11a

Choose a tag to compare

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

29 Jul 12:44
1.1.1-rc.1
da9077d

Choose a tag to compare

Sharg 1.1.1-rc.1 Pre-release
Pre-release

This is the first release candidate for Sharg 1.1.1

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).

Sharg 1.1.0

08 May 12:14
1.1.0
4723f2c

Choose a tag to compare

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

10 Oct 10:38
1.0.0
88ffb13

Choose a tag to compare

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 Gitter!

  • 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:

  1. A value that stores the command line parameter (nothing changed here)
  2. A sharg::config object (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 sharg instead of seqan3
  • Every occurrence of argument_parser has been replaced with parser
  • The concept seqan::parser_compatible_option has been renamed to sharg::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.