Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 24 18:15
    henryiii commented #562
  • Feb 24 17:50
    opelx closed #562
  • Feb 24 17:50
    opelx commented #562
  • Feb 24 17:45
    phlptp commented #562
  • Feb 24 17:41
    opelx commented #562
  • Feb 24 17:33
    phlptp commented #562
  • Feb 24 17:30
    phlptp commented #562
  • Feb 24 17:29
    opelx commented #562
  • Feb 24 17:21
    opelx commented #562
  • Feb 24 16:44
    phlptp commented #562
  • Feb 24 16:38
    henryiii commented #562
  • Feb 24 16:35
    opelx opened #562
  • Feb 22 14:44
    KOLANICH edited #561
  • Feb 22 14:44
    KOLANICH edited #561
  • Feb 22 14:43
    KOLANICH edited #561
  • Feb 22 14:40
    KOLANICH edited #561
  • Feb 22 12:40
    KOLANICH edited #561
  • Feb 22 12:33
    KOLANICH edited #561
  • Feb 22 12:32
    KOLANICH edited #561
  • Feb 22 12:28
    KOLANICH edited #561
Wolf Vollprecht
@wolfv
yes
but happy to store in something else if that's easier
Philip Top
@phlptp
I am running some tests now
Wolf Vollprecht
@wolfv
thx much appreciated!
this is for micromamba: github.com/mamba-org/mamba/
Philip Top
@phlptp
    TEST_F(TApp, SingleArgVector) {
     std::vector<std::string> channels;
    std::vector<std::string> iargs;
    std::string path;
    app.add_option("-c", channels)->type_size(1)->allow_extra_args(false);
    app.add_option("args",iargs);
    app.add_option("-p",path);

    app.parse("-c t1 -c t2 -c t3 a1 a2 a3 a4 -p happy");
    EXPECT_EQ(3u, channels.size());
    EXPECT_EQ(4u, iargs.size());
    EXPECT_EQ(path,"happy");
}
This is a test I wrote that is passing on master
Wolf Vollprecht
@wolfv
let me check with a small example as well, one sec
Philip Top
@phlptp

added

app.parse("-c t1 a1 -c t2 -c t3 a2 a3 a4 -p happy");
    EXPECT_EQ(3u, channels.size());
    EXPECT_EQ(4u, iargs.size());
    EXPECT_EQ(path, "happy");

and it still behaves as expected. Am I missing something?

Wolf Vollprecht
@wolfv
I made this smal test app:
#include <vector>
#include <string>
#include <CLI/CLI.hpp>

struct {
    std::vector<std::string> channels;
    std::vector<std::string> specs;
    std::string path;
} opts;

int main(int argc, char** argv)
{
    CLI::App app{ "Test" };
    app.add_option("-c", opts.channels)->type_size(1)->allow_extra_args(false);
    app.add_option("args",opts.specs);
    app.add_option("-p",opts.path);

    CLI11_PARSE(app, argc, argv);

    for (auto& c : opts.channels)
    {
        std::cout << "Channel: " << c << std::endl;
    }
    for (auto& c : opts.specs)
    {
        std::cout << "Spec: " << c << std::endl;
    }

    std::cout << "Path: " << opts.path;
    return 0;
}
Path: ~/Programs/mamba/cbuild:master$ ./args -c abc -c test abdjs jkds
Channel: abc
Channel: test
Channel: abdjs
Channel: jkds
Path: ~/Programs/mamba/cbuild:master$ ./args test 123 -c abc -c test 
Channel: abc
Channel: test
Spec: test
Spec: 123
this is my output
but I will try with master now and see if it makes a differnece
awesome
looks like it is indeed fixed in master :tada:
Philip Top
@phlptp
ok, that is nice to know. What version were you on?
Wolf Vollprecht
@wolfv
1.9.1
so no fix released :/
do you guys have any plans for a release?
Philip Top
@phlptp
Have to ask @henryiii for that. I think we made a few breaking changes so probably need to move to a 2.0 but I am not sure on a timeline.
Wolf Vollprecht
@wolfv
ah
so this is the fix? CLIUtils/CLI11#484
Philip Top
@phlptp
I think so
Wolf Vollprecht
@wolfv
hmm maybe I'll vendor a patched cli11
I disklike vendoring though :)
Henry Schreiner
@henryiii
I’ve been weighing the idea of picking out the non-breaking changes and making a 1.10. For 2.0, there are two to three big plans; a revamped single header creator (mostly ready), an optional pre-compile mode, and maybe no longer requireing exceptions be caught. The issue with both things really is just time. Busy trying to get pybind11 2.6 out next, amoung other things - pybind11 2.7/3.0 may also get a similar pre-compile option.
I just moved, and had/have a lot of other obligations, so haven’t had a clear window of time to get those things ready.
Wolf Vollprecht
@wolfv
sure!
would you consider a 1.9.2 with only he #484 pr?
that would make my day :)
Philip Top
@phlptp
I am using a modified version in our application, always takes a little while to get the changes ready for merging into CLI11 so most of the time our requirements are ahead of the CLI11 releases. But I keep working on getting them in the upstream repo when I have time.
Henry Schreiner
@henryiii
@phlptp is CLIUtils/CLI11#423 safe for a hypothetical 1.10?
Actually, could you add a “breaking” label or something similar for any PR that needs to go into 2.0 due to a change in API, etc?
(for your PRs)
That might help if I pick some up to make a 1.10.
Philip Top
@phlptp
I will have to look over it closely my suspicion is it would be as it makes some small changes to how type_size is interpreted and used.
Henry Schreiner
@henryiii
#484 builds (at least the tests) on #423
Wolf Vollprecht
@wolfv
what's the process to create the single-file include?
Wolf Vollprecht
@wolfv
ah found it (CLI11_SINGLE_FILE)
Jakob Lover
@jakoblover
@henryiii Anything with unicode support? Currently have to manually parse strings to paths using std::filesystem::u8path() :(
**I meant to ask if you have worked on unicode support lately
I guess that's an issue with the lexical cast
Jakob Lover
@jakoblover
When you require x options from a group, the following IF-block removes the -h,--help flag, but does not remove --help-all if that is enabled.
if(require_option_min_ > used_options || (require_option_max_ > 0 && require_option_max_ < used_options)) {
            auto option_list = detail::join(options_, [](const Option_p &ptr) { return ptr->get_name(false, true); });
            if(option_list.compare(0, 10, "-h,--help,") == 0) {
                option_list.erase(0, 10);
            }
            auto subc_list = get_subcommands([](App *app) { return ((app->get_name().empty()) && (!app->disabled_)); });
            if(!subc_list.empty()) {
                option_list += "," + detail::join(subc_list, [](const App *app) { return app->get_display_name(); });
            }
            throw RequiredError::Option(require_option_min_, require_option_max_, used_options, option_list);
        }
That should maybe be added. It's kinda cluttered in the error output
At least 1 option from [--help-all,.....]  is required
Run with --help or --help-all for more information.
There should be a check to remove --help-all (or whatever else you call that flag) if set_help_all_flag has been called
Jakob Lover
@jakoblover
Added an issue #527
Henry Schreiner
@henryiii
@phlptp FYI, I’m hoping to make a push toward 2.0 mid December, starting with the Python single-file generator overhaul.
Philip Top
@phlptp
ok, I will try to have some things I have been working on ready by then as well.
Henry Schreiner
@henryiii
@phlptp what’s the status of your PRs? Can I assume since they are not draft that I can review and merge? :)
Philip Top
@phlptp
all the ones that are in and are passing are ready for review