Open bimalgaudel opened 1 year ago
I got the same(?) issue. I have the following configuration:
| lyra::arg(configFile, "/path/to/config.json")
("Path to the config")
| lyra::opt(outputPath, "/path/to/folder/")
["--output"]
("Path to the output folder")
If I run my tool this way:
$ my-tool --output /tmp/some
then I get the problem decribed in the first post:
Unrecognized token: /tmp/some
And if I run it like this:
$ my-tool --output=/tmp/some
then it considers the entire --output=/tmp/some
to be the value for configFile
argument.
If I put the argument after the option:
| lyra::opt(outputPath, "/path/to/folder/")
["--output"]
("Path to the output folder")
| lyra::arg(configFile, "/path/to/config.json")
("Path to the config")
then everything works fine.
So yes, this is either a bug or a missing documentation saying that arguments should be added after options.
Results: Run:
<exe> --flag-this --flag-extra
Output:this |1| that |0| extra |1|
Run:<exe> --flag-extra --flag-this
Output:Unrecognized token: --flag-this
Looks like a bug. The order should not matter.