Skip to content

Conversation

@eseiler
Copy link
Member

@eseiler eseiler commented Aug 15, 2025

Subparsers do not have any metadata set.
When you already set metadata for the top-level parser, you need to do so again for the subparser.

This PR makes it so that some metadata is copied to the subparser:

Metadata Copied?
app_name
version
short_description
author
email
date
url
short_copyright
long_copyright
citation
man_page_title
man_page_section
description
synopsis
examples

Notes

  • copy_metadata_to_subparser could also be a member function of parser_meta_data for better encapsulation.
  • app_name is overwritten.
  • I don't think it makes sense to copy the other metadata too?

Example

Excerpts of the help page for top-level and subcommand.

Before

# Top-level
VERSION
    Last update: 2025-08-15
    FPGAlign version: 1.0.0
    Sharg version: 1.1.2-rc.1
    SeqAn version: 3.4.0-rc.4

LEGAL
    Author: Enrico Seiler
    SeqAn Copyright: 2006-2024 Knut Reinert, FU-Berlin; released under the 3-clause BSDL.
# Subcommand
VERSION
    Last update: 
    FPGAlign-build version: 
    Sharg version: 1.1.2-rc.1
    SeqAn version: 3.4.0-rc.4

After

# Top-level
VERSION
    Last update: 2025-08-15
    FPGAlign version: 1.0.0
    Sharg version: 1.1.2-rc.1
    SeqAn version: 3.4.0-rc.4

LEGAL
    Author: Enrico Seiler
    SeqAn Copyright: 2006-2024 Knut Reinert, FU-Berlin; released under the 3-clause BSDL.
# Subcommand
VERSION
    Last update: 2025-08-15
    FPGAlign-build version: 1.0.0
    Sharg version: 1.1.2-rc.1
    SeqAn version: 3.4.0-rc.4

LEGAL
    Author: Enrico Seiler
    SeqAn Copyright: 2006-2024 Knut Reinert, FU-Berlin; released under the 3-clause BSDL.

If members are not (explicitly) default-initialized, the compiler will warn/error about some members not being initialized.
This is only needed for tests, and hidden in the docs.
@seqan-actions seqan-actions added lint [INTERNAL] signals that clang-format ran and removed lint [INTERNAL] signals that clang-format ran labels Aug 15, 2025
@seqan-actions
Copy link
Member

Documentation preview available at https://docs.seqan.de/preview/seqan/sharg-parser/285

@codecov
Copy link

codecov bot commented Aug 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.46%. Comparing base (4480a90) to head (a6f81c3).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #285      +/-   ##
==========================================
+ Coverage   94.37%   94.46%   +0.08%     
==========================================
  Files          20       20              
  Lines        1637     1663      +26     
  Branches       47       47              
==========================================
+ Hits         1545     1571      +26     
  Misses         92       92              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eseiler eseiler merged commit f9c5c7b into seqan:main Aug 15, 2025
36 checks passed
@eseiler eseiler deleted the feature/copy_metadata_to_subparser branch August 15, 2025 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants