cmdline.arguments, providing a fully fledge commandlien argument parser specialized for R's data structures.
Welcome to the cmdline.arguments
package source repo. The home for R's own cmdline argument parser. As of 2021-03-01 this package is still in the early stages of it's development cycle, but once finished the intention is to provide the ultimate experience to the R community.
This package seeks to provide an answer to the problem "I want a standardized parser for commandline arguments for the R software language, allowing to parse any and all kinds of arguments to any and all of R's data types". Several packages already attempt to answer this question an fail, while some provide a more minimal solution. In the cmdline.arguments project we seek to not only copy another implementation, but instead let all other implementation inspire the development of this package extending where we find problems that occur in daily production code, to ensure reproducibility and simplicity for the end user, while allowing for more detailed customization for both individual and overall argument parsing.
The package is developed in R and currently requires C++17 and R-4.0.0 to function. This may change in the future, but is not an overall goal. We are always looking for contributions from experience R and Rcpp users as well as suggestions and bugs from the community so hit right into the issue tab and make your voice known!
The development process of cmdline.arguments is an iterative cycle, so any or all of the below described points may changed at any point up till version 1.0.0 (release). So while these do illustrate the release features of the current imagination of the package, do keep this in mind.
- Develope the "bones" of the package
- Implement handling for number of arguments
- Implement and est narg class, handling options 'N', '-N', '+N', '?', '*' and '+'
- Implement and test parser function class
- Extend
Rcpp::Function::invoke
to handle "given" number of arguments- Done through extending
Rcpp::pairlist
to useclass ArgumentList
- Done through extending
- Implement ArgumentList class
- Test return is identical for
Rcpp::Function
anddo.call
for all input types
- Extend
- Implement container for raw cmdline arguments (strings)
- Allow option for passing raw vector as
- individual parameters,
- a list with a single vector element
- a character vector
- Test and integrate with parser function class
- Allow option for passing raw vector as
- Implement and test commandline locater class
- Implement V1 (legacy idea)
- re-implement to comply with the idea of cmdline.arguments V2, raw_arguments and so on.
- Integrate all aspects with the argument and parser class
- Implement handling for number of arguments
- [-] Develope the "meat" of the package
- [-] Implement and test Printer class (for help messages)
- Implement and test V1
- Allow for "known" help argument across multiple arguments
- Implement Argument class
- Implement Lazy Evaluation
- Allow different handling for
-f a -f b
and-f a b
- Implement Parser class
- Implement Lazy Evaluation
- [-] Implement and test Printer class (for help messages)
- Develope the "skin" (API) of the package
- Decide upon exact format for the R api
- Implement individual functions for interacting with single Arguments and multiple Arguments (parser class).
- Implement R class for containing the C++ object pointers
In addition to the checklist above it is intended t
Note that this is not a complete list, and as the package is developed a maintained diagram of the meat and bones will be updated in the drawio folder describing the individual parts in a simplified flowchart.
The intention is that the horizon to finish the above is within the year 2021 and hopefully earlier than this.