Skip to content

Releases: trevorld/r-argparse

argparse v2.3.1

Choose a tag to compare

@trevorld trevorld released this 09 Oct 16:59
  • The ArgumentGroup R6 Class (as returned by ArgumentParser()$add_argument_group())
    now supports an add_mutually_exclusive_group() method (#59).
    Suggestion of Brar Piening (@Brar).

argparse v2.2.5

Choose a tag to compare

@trevorld trevorld released this 21 Dec 20:01
  • Tweaks the parse_known_intermixed_args() tests so they work with the development version of Python.

argparse v2.2.4

Choose a tag to compare

@trevorld trevorld released this 20 Nov 16:59
  • ArgumentParser()'s python_cmd argument is now wrapped by normalizePath(mustWork = FALSE).

argparse v2.2.3

Choose a tag to compare

@trevorld trevorld released this 09 Apr 23:44
  • Character values are now passed as "raw" strings to Python (#51).

    • In particular this avoids triggering an error in Python 3.12
      when creating a string with escapes not supported by
      Python e.g. default = "\\D" will continue to return a
      default value of "\\D" instead of triggering an error.

    • However, this also means that any Python accepted escape
      sequences will no longer be interpreted as an escape sequence.
      If relying on such behaviour you may need to instead use
      the appropriate R escape sequences or Unicode values instead of Python escape sequences:

    • Thanks Matthew Hall (@mdhall272) for bug report.

argparse v2.2.2

Choose a tag to compare

@trevorld trevorld released this 15 Feb 19:56
  • Fixes bug when add_argument() help values ended in a " (#46).
    Thanks Oliver Dreschel (@oliverdreschel) for bug report.

argparse v2.2.1

Choose a tag to compare

@trevorld trevorld released this 08 Dec 20:37
  • We now support the following ArgumentParser() methods:

    • format_help()
    • format_usage()
    • parse_intermixed_args() (#45)
    • parse_known_intermixed_args() (#45)
    • set_defaults() (#43). Suggestion of @oliverbothe.
  • When an error is thrown by ArgumentParser()$parse_args() and interactive() is FALSE
    and getOption("error") is NULL then
    we now use a quieter default error handler that doesn't output a trailing "Execution halted".

  • add_argument() now allows "numeric" as an alias for "double" for the type argument (#42).
    Suggestion of @dariober.

  • ArgumentParser() now handles description arguments with newlines in them (#44).
    Thanks Arthur Gilly (@agilly) for bug report.

argparse v2.1.6

Choose a tag to compare

@trevorld trevorld released this 17 Jul 20:26
  • The errors raised by ArgumentParser()$parse_args() are now of class "argparse_parse_error".

    They are now less verbose when interactive() is FALSE (#40).

    There may still be a trailing "Execution halted" line output by R's default error handler
    (when interactive() is FALSE).
    This can be silenced by setting a new error handler near the top of your Rscript e.g.

    if (!interactive())
        options(error=function(e) quit('no', status = 1, runLast = FALSE))

argparse v2.1.5

Choose a tag to compare

@trevorld trevorld released this 20 Apr 21:24
  • add_argument now uses as.logical() logic to cast variables
    to logical values if type = "logical" and action = "store" or action = "append"
    instead of using Python's bool() logic (#39).

    • We throw an error if we would get an NA by coercion.
    • We no longer throw a warning when using type = "logical" and action = "store"
      suggesting users instead use action = "store_true" or action = "store_false".

argparse v2.1.3

Choose a tag to compare

@trevorld trevorld released this 26 Nov 15:36
  • Prevents extraneous error message from being included in usage message
    when using Python 3.10 (#36).
    Thanks @dariober for bug report.

argparse v2.1.2

Choose a tag to compare

@trevorld trevorld released this 21 Oct 23:54
  • Fixes bug when using an argument with action == "append"
    and a non-NULL default value (#35).
    Thanks @miker985 for bug report.