Open Mitmischer opened 5 months ago
docopt
written and maintained by others. Note many of the other command-line passing packages aren't at v1.0 (so no promise of stable API) and I'm unsure how high their code coverage is or how actively maintained they are.optparse
when I only need to support a few optional arguments and argparse
when I need more advanced features like sub parsers and named positional arguments. argparse
note optparse
supports a "callback" feature which can call user-written functions.?getopt::getopt
I did compare getopt
with optparse
...Maybe instead of a detailed section in the README of at least three packages that each would need to be maintained maybe there should be a single "splendid" list of R option parsers with some comparisons of features.
An example of a "splendid" list of game-related R packages: https://github.com/matt-dray/splendid-r-games
All of those suggestions are very reasonable :) I think that having a "splendid" list that is referred to in the respective projects' READMEs would be the best solution. But of course, the choice is up to you - I just wanted to give you a completely new user's perspective on those packages and the initial confusion that comes along with it.
There is also argparser
which is written in pure R with no dependencies.
https://cran.r-project.org/web/packages/argparser/index.html
There is also argparser which is written in pure R with no dependencies.
{optparse}
was written there was only {getopt}
but now I think there are at least 8 R packages that do command-line parsing {argparser}
which like {getopt}
and {optparse}
are pure R packages with light dependencies but last time I checked it supported fewer features than {argrparse}
(which depends on Python), doesn't promise a stable API (assuming it follows semantic versioning), and doesn't show any code coverage statistics but depending on your needs might be a good choice.
Hello, I'm opening this issue here, but it might just as well be opened at the r-argparse-repo.
New users might need guidance on when to use r-argparse or r-optparse. It is unclear which package is superior to the other and the use cases are identical. From what I understood, r-argparse uses the python package as a backend, so it directly benefits from developments there, but therefore carries additional dependencies. r-optparse has more downloads but that might be for historical reasons and recommendations.
r-argparse appears to be more powerful (but maybe a bit more hurdlesome), due to its python-argparse backbone. Personally, I need support for multiple arguments (and I found issues #36, #22 discussing this and stating that it's missing), so I decided to go with r-argparse.
Note that this was only a very brief evaluation, but one could go into more detail here. Maybe putting a similar document to mine in both or at least one of the repos' READMEs might help users make the right decision. A feature comparison (maybe as a table) might be helpful, too.