We had recurrent discussions and comments on the parsing of command line arguments, see e.g. Question about Axel's news posts (Tests and Argparse)
Let me summarize and propose something; please leave your comments and ideas here. The ROOT team will not be able to work on this, but we’d be super happy to have a contribution!
We have command line argument parsing in MANY places in ROOT, see at the end of this post. They all use
strcmp. It would be nice to use the same argument parsing library for all, something including help output generation, error handling etc.
We would like to support
root -lbq as a synonym for
root -l -b -q.
Long options vs single dash / backward compatibility
We currently have some options that are “long” (more than one character) but are introduced by a single dash, e.g.
root -memstat or
root -config. We would like to keep those. It’s fine to pre-process them, replacing them with a new long synonym. I.e. introduce a new
"--memstat" argument, and if an
"-memstat", replace that argv with
"--memstat". Documentation should only mention
"--memstat". This makes ROOT’s options POSIX compliant (and makes most option parsing libraries happy) while keeping backward compatibility.
We want weak symbols to not clash with user code (think libRint.so linked against something a user uses themselves), e.g. a header-only library. An option could be https://github.com/jarro2783/cxxopts
- root.exe (
- PyROOT (
- Many tests (e.g. everything in
Note: rootcling is excluded here, it’s using llvm’s option parsing facilities to play well with cling.