Skip to content

Releases: jdwx/args

v2.0.0

Choose a tag to compare

@jdwx jdwx released this 22 May 23:45

This module has had a significant chunk of its functionality refactored into jdwx/quote.

Exceptions have been moved to a separate directory.

PHP 8.3 is now required.

v1.2.5

Choose a tag to compare

@jdwx jdwx released this 04 Apr 02:02

Small fix for PHP 8.4 compatibility. No functional change.

v1.2.4

Choose a tag to compare

@jdwx jdwx released this 17 Feb 18:26
  • Add ImplicitArgumentException to handle the case where the problem with the arguments isn't due to the arguments themselves.
  • Improved a couple of PHPDOC comments.

v1.2.3

Choose a tag to compare

@jdwx jdwx released this 10 Feb 01:29

Add Option::simpleArray() to provide an easy way to fetch options that can be specified multiple times.

v1.2.2

Choose a tag to compare

@jdwx jdwx released this 03 Feb 21:24

Added Option::simpleInt() and Option::simpleIntEx().

Added the ability to specify default-if-false values for Option::simpleString() and Option::simpleStringEx().

v1.2.1

Choose a tag to compare

@jdwx jdwx released this 30 Jan 06:40

Make string parsing a little easier to discover and use.

Also fixed a couple of small bugs and applied internal coding standards to the files, which were not previously correctly loaded for this project.

v1.2.0

Choose a tag to compare

@jdwx jdwx released this 30 Jan 05:28

Found an edge case with integer values being coerced to true while updating the examples.

Examples have been updated to show how the Option and Options classes work. The examples in the README.md are now also provided as example.php in the examples directory (mainly to make sure they work).

Because of the significant additions to option handling, we're bumping the minor version.

v1.1.17

Choose a tag to compare

@jdwx jdwx released this 30 Jan 04:27

Added separate classes to streamline processing two common types of optional command line flags, with or without associated values.

The Option class defines a single option and can be set from an Arguments object to handle and remove any matching references to that option. This can be used directly when there are just one or two simple options to process.

The Options class collects several Option objects together and provides an ArrayAccess interface to IParameter instances. This should be used when there are many options, the same set of options used in multiple places, or if you want to easily get a provided option value as (e.g.) an integer.

v1.1.16

Choose a tag to compare

@jdwx jdwx released this 18 Jan 23:41

Revert a change that caused breakage downstream.

Since we can't guarantee constructor arguments in subclasses, change Arguments::fromString() and Arguments::copy() to operate on self:: rather than static:: . This will necessitate overloading them in subclasses.

v1.1.15

Choose a tag to compare

@jdwx jdwx released this 18 Jan 22:23

Bug fix: If a default option was false, it wasn't being properly overwritten by a --foo flag.