jarro2783 / cxxopts

Lightweight C++ command line option parser
MIT License
4.17k stars 582 forks source link

Please improve explanation of positional arguments #371

Open VictorEijkhout opened 1 year ago

VictorEijkhout commented 1 year ago

The readme is very inadequate. There is a line

options.parse_positional({"script", "server", "filenames"})

which 1. does not end in a semicolon 2. does not have argc/argv unlike the regular parse call, 3. does not assign its result to anything. My best guess

auto kwresult = options.parse_positional( {"foo"} );

has "incomplete type" according to gcc.

Please clarify.

jarro2783 commented 1 year ago

The parse_positional function sets options as being positional, it doesn't actually parse anything by itself. I will clarify the explanation and maybe change its name too.

jarro2783 commented 1 year ago

I've updated the readme, does that help?

VictorEijkhout commented 1 year ago

Much better, thanks.