Skip to content

Variable number of parameters for a command #93

Answered by daniele77
grbba asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @grbba .

First of all, thank you for using the CLI library and contributing to the community with your good question. Please add a star to the project and -- if you feel really generous -- you can consider becoming a sponsor by clicking the heart button on top of the page :-)

I moved your question to "GitHub discussions" because it's more appropriate here.

Currently, the library allows adding a command with a variable number of std::string parameters. You can see it in the complete example that comes with the library:

rootMenu->Insert(
        "sort",
        [](std::ostream& out, std::vector<std::string> data)
        {
            std::sort(data.begin(), data.end());
            out …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@grbba
Comment options

@daniele77
Comment options

@grbba
Comment options

Answer selected by grbba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #92 on February 04, 2021 08:48.