PHPackages                             sasezaki/docopt - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. sasezaki/docopt

ActiveLibrary[CLI &amp; Console](/categories/cli)

sasezaki/docopt
===============

Fork of Port of Python's docopt

1.0.3(9y ago)013MITPHPPHP &gt;=5.3.0

Since Aug 9Pushed 8y ago1 watchersCompare

[ Source](https://github.com/sasezaki/docopt.php)[ Packagist](https://packagist.org/packages/sasezaki/docopt)[ Docs](http://github.com/docopt/docopt.php)[ RSS](/packages/sasezaki-docopt/feed)WikiDiscussions sasezaki/master Synced 4d ago

READMEChangelogDependencies (2)Versions (10)Used By (0)

`docopt` creates *beautiful* command-line interfaces
----------------------------------------------------

[](#docopt-creates-beautiful-command-line-interfaces)

[![https://travis-ci.org/docopt/docopt.php.svg?branch=master](https://camo.githubusercontent.com/b0306d68ef25c089476d9b5bc5224589004e3faeacc480efc4c163fe87a03fb2/68747470733a2f2f7472617669732d63692e6f72672f646f636f70742f646f636f70742e7068702e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/b0306d68ef25c089476d9b5bc5224589004e3faeacc480efc4c163fe87a03fb2/68747470733a2f2f7472617669732d63692e6f72672f646f636f70742f646f636f70742e7068702e7376673f6272616e63683d6d6173746572)

This is a straight PHP transliteration of Vladimir Keleshev's brilliant [docopt](https://github.com/docopt/docopt/) Python library. There are a few artefacts in the code as a result that may seem inefficient and non-idiomatic to PHP, this has been done to make integrating changes more efficient.

As a result, unless a bug is present only in the PHP version, pull requests are unlikely to be accepted unless they are themselves direct transliterations of bugfixes in the Python version.

**This port has been marked version 1.0**. It is based on the Python version at commit [a093f938b7f26564434f3c15a1dcc39e017ad638](https://github.com/docopt/docopt/commit/a093f938b7f26564434f3c15a1dcc39e017ad638)(labelled **0.6.2**).

It has been quite stable for a long time and has barely been changed. The Python version receives only occasional bugfixes and keeping the version numbers pinned has been more trouble than it has been worth.

There are also some major backward compatibility breaks. Rather than dwell in 0.x semver hell, the PHP port will liberally bump major numbers henceforth when BC breaks regardless of the reason.

- The PHP API has changed slightly. `Docopt\docopt()` has been renamed to `Docopt::handle()` to fix autoloader support. See [issue #3](https://github.com/docopt/docopt.php/pull/3).
- Docopt.py also has a significant BC break. Existing users should read the information below about Usage and Option sections. See [issue 102](https://github.com/docopt/docopt/issues/102) for more info.

Please see the [Python version's README](https://github.com/docopt/docopt/blob/master/README.rst)for details of any new and breaking changes that are not specific to the PHP version.

---

Isn't it awesome how `optparse` and `argparse` generate help messages based on your code?!

*Hell no!* You know what's awesome? It's when the option parser *is*generated based on the beautiful help message that you write yourself! This way you don't need to write this stupid repeatable parser-code, and instead can write only the help message--*the way you want it*.

**docopt** helps you create most beautiful command-line interfaces *easily*:

```
