NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #2307 most downloaded on Packagist
Command line arguments parser for PHP 7.1 and above
Latest stable
v4.0.4
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 2 months to 2.2 years
Nearly every release is documented
notes for 30 of 31 stable releases
Nothing withdrawn
no release was ever pulled
15 years old
41 releases · first in 2012
Drag across the ruler to compare, or tap a release to open it.
fix nullable parameters (many thanks to @AdamSGit)
Changelog:
add Catalan translations (many thanks to @playinteractive )
Changelog:
Your coding agent can read these notes before it upgrades. Set up the MCP server →
add php 8.0 to compatibility list in composer.json
Changelog:
fix ArrayAccess signature compatibility in php 8.1 (mixed return value; see #171 )
Changelog:
drop support for php 5.x and add support for php 8
Changelog:
This release is for testing the new version.
This release is for testing the new version.
This might be the last version 3 version as we might get rid of the php 5.x compatibility.
allow long options with only one character (solves #143)
Changelog:
allow long options with only one character (solves #143)
Changelog:
accept option arguments starting with a hypen when argument is required
divide getValue and getDefault in attributes
add translation system to translate user errors (solves #108)
add translation system to translate user errors (solves #108)
add ext-mbstring requirement (solves #130)
allow dashes as breaks in descriptions
return an empty array for multiple operands (solves #119 and #124)
getters for Command, Argument, Option, Operand and GetOpt changed
This is a pre release for version 3.1. The help is still not adapted and the release has to wait for it.
This is a pre release for version 3.1. The help is still not adapted and the release has to wait for it.
fixed iterator to iterate over empty values (solves #93)
fixed homepage url in composer.json (thanks to malaire)
fixed: Operand::required() made the operand multiple on second call (solves #84)
Operand::required() made the operand multiple on second call (solves #84)Operand::multiple() for sake of consistenceMany changes have been made. People already using version 2.* will have to change their code on some places. The most important: the class name and th
Many changes have been made. People already using version 2.* will have to change their code on some places. The most important: the class name and the namespace have changed. If you don't want to change everything just change your use-Statement:
// use ulrichsg\Getopt;
use GetOpt\GetOpt as Getopt;
GetOptGetOptGetOpt::SETTING_* constants):*ArgGetOpt::MULTIPLE_ARGUMENT for parameter aggregation (solves #57)Command for kinda routing in console applications (solves #41)Operand for named operands and validation (solves #27)HelpInterface for custom help implementationsGetOpt::getHelpText() for better support of other features and customizationGetOpt::count() returns the wrong value (solves #70)Many changes have been made. People already using version 2.* will have to change their code on some places. The most important: the class name and th
Many changes have been made. People already using version 2.* will have to change their code on some places. The most important: the class name and the namespace have changed. If you don't want to change everything just change your use-Statement:
// use ulrichsg\Getopt;
use GetOpt\GetOpt as Getopt;
GetOptGetOptGetOpt::SETTING_* constants):*ArgGetOpt::MULTIPLE_ARGUMENT for parameter aggregation (solves #57)Command for kinda routing in console applications (solves #41)Operand for named operands and validation (solves #27)HelpInterface for custom help implementationsGetOpt::getHelpText() for better support of other features and customizationGetOpt::count() returns the wrong value (solves #70)fixed return value of GetOpt::getOption() for an option with multiple argument but without default value
Changelog:
GetOpt::getOption() for an option with multiple argument but without default valueMajor changes to command interface.
Major changes to command interface.
Some slightly changes to the API for Command.
Some slightly changes to the API for Command.
Because the OptionParser is static now the default mode is a public static property too. All instances from GetOpt and Command use the same default mode. For backward compatibility you can still use the SETTING_DEFAULT_MODE for GetOpt.
Nothing published for this version
Many changes have been made. People already using version 2.* will have to change their code on some places. The most important: the class name and th
Many changes have been made. People already using version 2.* will have to change their code on some places. The most important: the class name and the namespace have changed. If you don't want to change everything just change your use-Statement:
// use ulrichsg\Getopt;
use GetOpt\GetOpt as Getopt;
GetOptGetOptGetOpt::SETTING_* constants):*ArgGetOpt::MULTIPLE_ARGUMENT for parameter aggregation (solves #57)Command for kinda routing in console applications (solves #41)Operand for named operands and validation (solves #27)HelpInterface for custom help implementationsGetOpt::getHelpText() for better support of other features and customizationGetOpt::count() returns the wrong value (solves #70)moved documentation to master branch
Changelog
Features:
don't show options when there are no options configured
merged tflori/getopt-php
Changelog:
Features:
Optional argument descriptions (courtesy of @sabl0r)
Added method to customize the help message (courtesy of @mfn)
Features:
Added setters for default values and validation to Option
Features:
Argument validation (courtesy of @jochenvdv)
Features:
Long options are required to be longer than 1 character
Bugfixes:
Options can be numeric (courtesy of @patinthehat)
Features:
ArrayAccess, Countable and Traversable support
Features:
Allow passing incomplete option arrays
Features:
Added help text printing functionality
Features:
Bugfixes:
Fixed bug where '0' could not be passed as an option value
Bugfixes:
Nothing published for this version
One column per quarter.