{"id":28351421,"url":"https://github.com/phalcon/cli-options-parser","last_synced_at":"2026-03-04T10:02:37.141Z","repository":{"id":41081529,"uuid":"126360909","full_name":"phalcon/cli-options-parser","owner":"phalcon","description":"Command line arguments/options parser to use in Phalcon applications.","archived":false,"fork":false,"pushed_at":"2025-09-15T17:27:16.000Z","size":124,"stargazers_count":18,"open_issues_count":0,"forks_count":8,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-12-26T15:23:23.349Z","etag":null,"topics":["cli","command","command-line","getopt","line","option","parser","phalcon"],"latest_commit_sha":null,"homepage":"https://phalcon.io","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phalcon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"phalcon","open_collective":"phalcon"}},"created_at":"2018-03-22T16:03:33.000Z","updated_at":"2025-09-15T17:27:16.000Z","dependencies_parsed_at":"2024-01-23T21:30:58.117Z","dependency_job_id":"23affc45-a271-4613-9170-5fdf3d66c331","html_url":"https://github.com/phalcon/cli-options-parser","commit_stats":{"total_commits":54,"total_committers":9,"mean_commits":6.0,"dds":0.6666666666666667,"last_synced_commit":"3bd72b452df47a0c64a766dea7d349e89efc57d5"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/phalcon/cli-options-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon%2Fcli-options-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon%2Fcli-options-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon%2Fcli-options-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon%2Fcli-options-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phalcon","download_url":"https://codeload.github.com/phalcon/cli-options-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon%2Fcli-options-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30078307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T08:01:56.766Z","status":"ssl_error","status_checked_at":"2026-03-04T08:00:42.919Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command","command-line","getopt","line","option","parser","phalcon"],"created_at":"2025-05-27T22:10:47.611Z","updated_at":"2026-03-04T10:02:37.121Z","avatar_url":"https://github.com/phalcon.png","language":"PHP","funding_links":["https://github.com/sponsors/phalcon","https://opencollective.com/phalcon"],"categories":[],"sub_categories":[],"readme":"# Cop\n\n[![PDS Skeleton](https://img.shields.io/badge/pds-skeleton-blue.svg?style=flat-square)](https://github.com/php-pds/skeleton)\n![GitHub License](https://img.shields.io/github/license/phalcon/cli-options-parser)\n![Codacy Grade](https://img.shields.io/codacy/grade/4064c9bc35634505852e41aedaa9386c)\n![Codacy Code Coverage](https://img.shields.io/codacy/coverage/4064c9bc35634505852e41aedaa9386c)\n![Downloads](https://img.shields.io/packagist/dm/phalcon/cli-options-parser)\n\nCommand line arguments/options parser.\n\n## Requirements\n\n*   PHP \u003e= 8.0\n\n## Installing via [Composer](https://getcomposer.org)\n\nInstall composer in a common location or in your project:\n\n```bash\ncomposer require phalcon/cli-options-parser\n```\n\n## Usage\n\n```php\nuse Phalcon\\Cop\\Parser;\n\n$parser = new Parser();\n\n// Parse params from the $argv\n$params = $parser-\u003eparse($argv);\n\n// Parse params from the $_SERVER['argv']\n$params = $parser-\u003eparse();\n\n// After parsing input, Parser provides a way to gets booleans:\n$parser-\u003egetBoolean('foo');\n\n// Get param `foo` or return TRUE as a default value\n$parser-\u003egetBoolean('foo', true);\n```\n\n### Examples\n\n```\nphp test.php -az value1 -abc value2\n[\n    'a' =\u003e 'value2',\n    'z' =\u003e 'value1',\n    'b' =\u003e 'value2',\n    'c' =\u003e 'value2',\n]\n\nphp test.php -a value1 -abc value2\n[\n    'a'  =\u003e 'value2',\n    'b'  =\u003e 'value2',\n    'c'  =\u003e 'value2',\n]\n\nphp test.php --az value1 --abc value2\n[\n    'az'  =\u003e 'value1',\n    'abc' =\u003e 'value2',\n]\n\nphp test.php --foo --bar=baz --spam eggs\n[\n    'foo'  =\u003e true,\n    'bar'  =\u003e 'baz',\n    'spam' =\u003e 'eggs',\n]\n\nphp test.php -abc foo\n[\n    'a' =\u003e 'foo',\n    'b' =\u003e 'foo',\n    'c' =\u003e 'foo',\n]\n\nphp test.php arg1 arg2 arg3\n[\n    0 =\u003e 'arg1',\n    1 =\u003e 'arg2',\n    2 =\u003e 'arg3',\n]\n\nphp test.php \\\n    plain-arg \\\n    --foo \\\n    --bar=baz \\\n    --funny=\"spam=eggs\" \\\n    --also-funny=spam=eggs \\\n    'plain arg 2'\n    -abc \\\n    -k=value \\\n    \"plain arg 3\" \\\n    --s=\"original\" \\\n    --s='overwrite' \\\n    --s\n[\n    0            =\u003e 'plain-arg',\n    'foo'        =\u003e true,\n    'bar'        =\u003e 'baz',\n    'funny'      =\u003e 'spam=eggs',\n    'also-funny' =\u003e 'spam=eggs',\n    1            =\u003e 'plain arg 2',\n    'a'          =\u003e true,\n    'b'          =\u003e true,\n    'c'          =\u003e true,\n    'k'          =\u003e 'value',\n    2            =\u003e 'plain arg 3',\n    's'          =\u003e 'overwrite',\n]\n```\n\n## License\n\nThe Cop is open source software licensed under the [MIT License](https://github.com/phalcon/cli-options-parser/blob/master/LICENSE).\n\n© Phalcon Team\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalcon%2Fcli-options-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphalcon%2Fcli-options-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalcon%2Fcli-options-parser/lists"}