Skip to content

add a version callback similar to help #436

@phlptp

Description

@phlptp

I am wondering how much use a dedicated version option, like help/help_all/config would be. It is similar to help in that it should bypass the other error checks and required options.

I know we end up putting it in most use cases in some way or another, having it be embedded in CLI11 would standardize and make it easier for everyone.

I would picture something like
an overload set

app.set_version(string version_string);
app.set_version(std::function<std:;string()> version_callback);  
app.set_version(string version_args, string version_string);
app.set_version(string version_args, std::function<std:;string()> version_callback);  

this would add a version option ("-v,--version" that triggers a version_exception and is triggered like help does currently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions