CFShell 0.2: Even More CLI Goodness for CFML Servers
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
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:
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:
.print expr: Surrounds expr with #'s and evaluates it.
You can also use .# as a shorthand.
Example:
{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!