phingofficial/phing

Suggestions for ExecTask

Closed this issue · 4 comments

Is your feature request related to a problem? Please describe.

Frequently I see Exec used like this:

<target name="download">
	<exec executable="wget">
	    <arg value="-Obuild/composer.phar" />
	    <arg value="http://getcomposer.org/composer.phar" />
	</exec>
</target>

However you can achieve the same using HttpGetTask, which it seems more appropriate to me.

Describe the solution you'd like

So I'm thinking about adding "suggestions" when some executable are used.

For example, when wget executable is used, Phing will print a suggestion:

$ phing download

Buildfile: /home/deleteme/build.xml

project > download:

     [Exec] Consider using HttpGetTask <==SUGGESTION

BUILD FINISHED

Total time: 0.3684 seconds

Similar suggestion messages can be displayed for things like executable="mv" (use MoveTask) or executable="zip" (use ZipTask).

Describe alternatives you've considered

The alternative is not implement this :)

Additional context

On one hand I think this can be very useful to use the correct Task, on the other hand maybe is too intrusive/verbose.

What are your thoughts? I can work in this feature in you want.

As usual feel free to close this issue if you want :)

@siad007 I think you are right, even if this means that suggestion are going to be rarely displayed :(
Maybe output level can be changed in the future if needed?

It might be easy implemented with an own phing command argument like phing -task-suggestions / phing -ts to turn the feature on if needed.

oh, a think a custom option is too much, verbose log is ok for me :)
Please see #1643