https://github.com/diversen/parse-argv
Parse argv and get - and -- flags and values, and get any value without a flag.
https://github.com/diversen/parse-argv
argv php php-argv php-argv-parser
Last synced: 5 months ago
JSON representation
Parse argv and get - and -- flags and values, and get any value without a flag.
- Host: GitHub
- URL: https://github.com/diversen/parse-argv
- Owner: diversen
- Created: 2016-06-16T14:44:08.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2023-03-22T06:22:59.000Z (over 3 years ago)
- Last Synced: 2025-07-23T19:04:40.127Z (about 1 year ago)
- Topics: argv, php, php-argv, php-argv-parser
- Language: PHP
- Homepage:
- Size: 36.1 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple argv parser
Any options are denoted by '-' or '--' and any option value must be specified by '='
You may cast options to int, float or booleans
## Install:
composer require diversen/parse-argv
## Example
Run the following test script:
php example.php -h --help --message=hello --to-int=100 --to-float=100.5 --to-bool=false argument1 argument2
See: [example.php](example.php)
## Test
git clone git@github.com:diversen/parse-argv.git
cd parse-argv
composer install
./test.sh
License MIT