I am a web developer, born in PERU and now living in PDX. My platform of choice is CFML but I'm always open to learn anything. I currently work for Mentor Graphics.

I also do freelance web development and have a few open source projects that I maintain.

Where To Find Me:

CFShell 0.2: Even More CLI Goodness for CFML Servers

October 09, 2009

Today I uploaded to RIAForge an update to CFShell. This update focused on making the client behave more like a standard command line tool, and also added a couple of useful commands and shorthand expressions to the shell.

Here are the changes on this version:

Client-side Improvements

When invoking the cfshell client you now can use command line options in a more standard way. The options supported are:

-p or --path: This option is used to indicate the location on server of the directory that contains the cfshell.cfm template.
If not passed cfshell will use: http://localhost/cfshell/
-q or --quiet: Use this option to avoid output of status or confirmation messages. Errors will still be displayed though.
-i or --input: Used to provide a statement to evaluate inmmediately instead of have cfshell prompt you for input. After evaluation cfhsell terminates.
-f or --file: Path to a file to use as the input for cfshell. If given, cfshell will process the contents of the file as CFML statements and return any generated output.

Also, if you are running any *nix variant, cfshell can now be executed directly from the command line (assuming you have python installed) just by calling

$ ./cfshell.py

Server-Side Improvements

The restriction for the localhost is still in place, but in case anyone wants to change this, I added a list of "Allowed" clients. To modify this, change the following line:

<cfset _lstAllowedClients = "127.0.0.1">

This is line 3 of cfshell.cfm

Also, I added support for a few more commands:

.new var_name cfc_path: This is a shorthand for:

<cfset var_name = createObject("component","cfc_path")>

.print expr: Surrounds expr with #'s and evaluates it.
You can also use .# as a shorthand.
Example:
>> #now()#
{ts '2009-10-08 21:05:51'}
>> .print now()
{ts '2009-10-08 21:05:51'}
>> .# now()
{ts '2009-10-08 21:05:51'}

.cfscript expr: Evaluates the rest of the line as cfscript statements and returns any generated output.
You can also use .cfs as a shorthand for .cfscript

That's it for now, thanks to everyone that tried cfshell and sent their input. If anyone has some more ideas on how to improve cfshell or maybe how they would like to use I'd like to hear that too.

Enjoy!


Posted on October 09, 2009      2 Comments

Related:
Sameer Gupta's Gravatar Sameer Gupta ...
Thanks! I love it.
October 11, 2009 03:43 PM
Ramon Barahona's Gravatar Ramon Barahona ...
Really Nice !
October 12, 2009 01:26 PM

All comments are moderated to prevent spam
Leave a comment