[TxMt] one more update to command line tool

Eric Hsu erichsu at math.sfsu.edu
Fri Jan 14 22:40:47 UTC 2005


Three changes.

I fixed the -w flag to await the closing of the editing window 
without any RETURN prompt.  I stole the code from Marcin's 
<otheraccount at verizon.net> recent script. (What is Marcin's last 
name?)

I added a -t flag like bbedit, so you can name the piped input.

I also added the ability to pass a -u flag so filenames are treated 
as URLs. It then uses curl to decipher/download the filenames and 
passes the results to TM. Unfortunately, this only works for 
anonymous FTP and not most FTP/SFTP setups. I'm sure someone 
enterprising could do it, but it doesn't seem worth it unless TM 
saves files back to S/FTP. On the other hand, bbedit doesn't handle 
http at all!  :)

Here is the current help file.

>TextMate Command Line Tool
>usage: tm [-chtuw] filename [filename ...]
>
>This tool opens files, directories, URLs or (with no filenames) 
>standard input.
>
>     -c Create a new file.
>     -h Show this help.
>     -t Specify a title for piped input. Overrides other flags.
>     -u Treat filenames as URLs (e.g. tm -u www.google.com). Uses curl.
>     -w Waits for the edited file window to close before ending (for 
>external editing)

Here is (from what I can tell) lacking in comparison to bbedit.

- jump to line number
	(probably you'd want to use a command with output parsing anyway... 
see e.g. Perl>PerlErrors)
- print (probably needs some Applescript... Marcin?)
- FTP/SFTP (prob need support from TM itself)

The latest script is still at 
<http://macromates.com/svn/Bundles/trunk/Scripts/tm>.

best wishes, Eric
-- 
Eric Hsu, Assistant Professor of Mathematics
San Francisco State University
erichsu at math.sfsu.edu
http://math.sfsu.edu/hsu



More information about the textmate mailing list