how to make shorthand commands using phing

91 views Asked by At

Suppose I have an executable for, e. g. Behat (doesn't matter, though) inside vendor/bin/ under root of my codebase. Its config lies under build/configs/and the test specs lie under tests/suites/acceptance/. All this directories are under root of codebase.

So, invocation of Behat for a single spec called featurename would be:

vendor/bin/behat --config build/configs/behat.yml tests/suites/acceptance/featurename.feature

With Phing this can be collapsed to:

phing spec featurename

However, my question is: how to pass other behat's commandline arguments using the phing shorthand command? Like that:

phing spec featurename -- -f html -p profilename --no-colors

Everything after -- expected to be passed to Behat verbatim.

Note, I am using Behat only as an example, I have other executables to wrap the similar way. I remember that some programs from GNU did that but don't remember which now.

Is this even possible? Do I need to recreate the whole interface of Behat inside the task definition to do this?

P. S. I had a hard time trying to formulate the question title, so feel free to edit it to something more appropriate.

1

There are 1 answers

1
Nev Stokes On BEST ANSWER

It's easy enough, you can pass arguments to Phing using -D<property>=<value> but yes, you'd probably need to incorporate all that into your task definition.

http://www.phing.info/docs/guide/stable/apas02.html