/cmdline.arguments

cmdline arguments is a project which seeks to provide a fully fledged package for specifying commandline parameters. It seeks to improve upon existing solutions which has not given enough flexibility to truly motivate R applications to flourish.

Primary LanguageC++GNU General Public License v3.0GPL-3.0

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!

Where are we in the development process before release?

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 use class ArgumentList
      • Implement ArgumentList class
      • Test return is identical for Rcpp::Function and do.call for all input types
    • Implement container for raw cmdline arguments (strings)
      • Allow option for passing raw vector as
        1. individual parameters,
        2. a list with a single vector element
        3. a character vector
      • Test and integrate with parser function class
    • 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
  • [-] 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
  • 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.