From: Ryan Davis Date: 2011-12-06T04:59:34+09:00 Subject: Re: rake --dry-run: how to see what sh commands will be run? On Dec 2, 2011, at 09:14 , La Wi wrote: > I am trying to set up some rules to build files with locally installed > tools. I have no trouble getting my rules to work, and to invoke shell > commands with sh(). > > However, what I can't figure out is how to get a display of shell > commands without actually excecutiing them. I thought I could run 'rake > --dry-run' but that seems to display only the filenames that would be > updated. > > I've found that setting 'verbose true' in my Rakefile causes the shell > commands to be displayed as they are executed. And I've found that > setting 'nowrite true' does EXACTLY what I want, but I can't figure out > how to turn it on via a rake command flag. > > I looked in the rake.rb source (rake-0.8.3), and it LOOKS like --dry-run > should set both 'verbose' and 'nowrite' for me. But I can't seem to get > actual verbose or dryrun behaviors unless I set them in my Rakefile. I'm pulling this completely out of my butt... but you might want to try something along the lines of: if Rake.application.trace then alias old_sh sh def sh(*a) old_sh "echo", *a end end P.S. I would LOVE to see a ruby port of Jam if you were so inclined. For C projects it is a vastly superior tool. :)