[TxMt] HOWTO: Debug Commands Using Scope as Input

Alain O'Dea alain.odea at gmail.com
Sat Mar 29 18:35:15 UTC 2008


The following process will give you a command which you can run to  
help debug commands:
1) Create a Command in the Bundle Editor called "Command Output"
2) Paste the following script into the Bundle Editor:
	#!/usr/bin/env ruby
	print '<pre>'
	print while gets
	print "\n"
	print "------------\n"
	print "END OF STDIN\n"
	print "------------\n"
	print `env | sort`
	print '</pre>'
3) Set Input to Selected Text or Scope
4) Set Output to Show as HTML
5) Set the scope to whatever scope you want to use in your command

Try it out. It will dump the input followed by a divider followed by  
the entire environment supplied to the command.

I used this to determine what TextMate was supplying to the Command I  
was writing.



More information about the textmate mailing list