Skip to content

Commit

Permalink
Remove CLI command - it is nubs/which-cli now.
Browse files Browse the repository at this point in the history
The CLI command was funny due to dependencies.  I didn't want to have
symfony/console be a dependency of the which library, but it is
necessary for the CLI command.  This meant that users wanting the
command would have to make sure to also install symfony/console
themselves.

As a separate package, this alleviates the concern.  I did a manual
subtree split plus cleanup in order to pull out the which command into
its own repository (without losing history :)).  People wanting the CLI
can pull that package in and it can have a hard dependency on
symfony/console.
  • Loading branch information
nubs committed Jul 10, 2014
1 parent ae8a4b2 commit 888d271
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 328 deletions.
25 changes: 3 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,25 +152,6 @@ var_dump($locator->locateAll('bin/php'));
```

### CLI Interface
Also included is a `which` executable that works much like the standard which
utility. It takes an arbitrary number of parameters and outputs the path to
each of them.

```bash
$ ./bin/which more vim foo
/bin/more
/usr/bin/vim
foo not found
```

The command is configured as a binary with composer, so it is accessible in
`vendor/bin/which` when you install the package. For a global install, this
means that you can find it in `$COMPOSER_HOME/vendor/bin/which`. This command
does require the symfony/console package to be installed and accessible via the
autoloader.

For windows users, the preferred installation method is using composer, i.e.
via `composer global require`. Composer will create a `which.bat` script in
its bin directory that can be executed. Alternatively, a `which.bat` script is
included. You may need to add the `bin` directory from this repository to your
`PATH` environment variable to be able to access the command globally.
There is also a CLI interface for both POSIX systems and Windows that imitates
the standard which command. It is available as
[`nubs/which-cli`](https://github.com/nubs/which-cli).
23 changes: 0 additions & 23 deletions bin/which

This file was deleted.

3 changes: 0 additions & 3 deletions bin/which.bat

This file was deleted.

2 changes: 1 addition & 1 deletion build.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'vendor/autoload.php';

$phpcsCLI = new PHP_CodeSniffer_CLI();
$phpcsViolations = $phpcsCLI->process(['standard' => ['PSR1'], 'files' => ['bin', 'src', 'tests', 'build.php']]);
$phpcsViolations = $phpcsCLI->process(['standard' => ['PSR1'], 'files' => ['src', 'tests', 'build.php']]);
if ($phpcsViolations > 0) {
exit(1);
}
Expand Down
9 changes: 2 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nubs/which",
"description": "A library for locating commands in a PATH.",
"keywords": ["which", "script", "path", "executable", "linux"],
"keywords": ["which", "script", "path", "executable", "linux", "windows"],
"authors": [
{
"name": "Spencer Rinehart",
Expand All @@ -15,17 +15,12 @@
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"symfony/console": "~2.5",
"brianium/habitat": "~1.0",
"squizlabs/php_codesniffer": "~1.5"
},
"suggest": {
"brianium/habitat": "For better access to environment variables (e.g., for mocking).",
"symfony/console": "For the executable which command."
"brianium/habitat": "For better access to environment variables (e.g., for mocking)."
},
"bin": [
"bin/which"
],
"autoload": {
"psr-4": {
"Nubs\\Which\\": "src"
Expand Down
59 changes: 1 addition & 58 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 0 additions & 79 deletions src/Application/WhichApplication.php

This file was deleted.

50 changes: 0 additions & 50 deletions src/Application/WhichCommand.php

This file was deleted.

85 changes: 0 additions & 85 deletions tests/Application/WhichApplicationTest.php

This file was deleted.

0 comments on commit 888d271

Please sign in to comment.