10000 Named args with parameters' args don't appear in usage · Issue #35 · bfgroup/Lyra · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Named args with parameters' args don't appear in usage #35
Closed
@mattgodbolt

Description

@mattgodbolt

In the config:

#include <lyra/lyra.hpp>
#include <string>

int main(int argc, const char *argv[]) {
  std::string named_required;
  std::string optional;
  auto cli = lyra::opt(named_required,
                  "required-arg")["--required"]("You must supply this arg")
            .required() |
        lyra::arg(optional, "optional")("This is an optional arg");

    std::cout << cli << "\n";
}

The output is:

USAGE:
  <executable> --required [<optional>]

OPTIONS, ARGUMENTS:
  --required <required-arg>
                          You must supply this arg
  <optional>              This is an optional arg

The --required in the USAGE: line does not refer to the required parameter name. I'd expect to see:

USAGE:
  <executable> --required <required-arg> [<optional>]

OPTIONS, ARGUMENTS:
  --required <required-arg>
                          You must supply this arg
  <optional>              This is an optional arg

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0