phar-io / phive

The Phar Installation and Verification Environment (PHIVE)
https://phar.io
BSD 3-Clause "New" or "Revised" License
580 stars 45 forks source link

Throw error for bad arguments #55

Closed mihaeu closed 8 years ago

mihaeu commented 8 years ago

My problem is similar to #29 but additionally to adding aliases (or changing the single dashes to double dashes) it would be nice if bad arguments produce errors.

When using phive install --copy phpunit it just symlinks, when instead it should tell me that there's no --copy flag.

    --target        Set custom target directory for the PHAR

    -copy           Copy PHAR file instead of using symlink
    -global         Install PHAR globally (likely to require root privileges)
    -temporary      Do not add entries in phive.xml for installed PHARs

Another example using a non-existing flag which doesn't provide any error:

phive install --duck phpdox
Phive 0.3.0 - Copyright (C) 2015-2016 by Arne Blankerts, Sebastian Heuer and Contributors
sebastianheuer commented 8 years ago

👍

We will implement this kind of behaviour when we refactor the argument parsing for #29 :)

theseer commented 8 years ago

Added with commit 4e71c841a1faae485edbb096b707c8c2e9ce4183, graceful handling rather than crashing yet to be added.

theseer commented 8 years ago

Fixed with commit 9cf5c2a920a12a7c6469e3aef5ed5bf5f9e8a80b.