commandbox.system.modules_app.system-commands.commands

Class cfml

lucee.Component
    extended by commandbox.system.modules_app.system-commands.commands.cfml

I am a shortcut to run single CFML functions via the REPL. This example runs the now() function. It is the equivalent to "repl now()". . {code:bash} cfml now {code} As a handy shortcut, you can invoke the "cfml" command by simply typing the name of the CFML function, preceded by a # sign. {code:bash} #now {code} When you pass parameters into this command, they will be passed directly along to the CFML function. {code:bash} #hash mypass #reverse abc {code} This really gets useful when you start piping input into CFML functions. Like other CFML commands, piped input will get passed as the first parameter to the function. This allows you to chain CFML functions from the command line like so. (Outputs "OOF") {code:bash} #listGetAt www.foo.com 2 . | #ucase | #reverse {code} Since this command defers to the REPL for execution, complex return values such as arrays or structs will be serialized as JSON on output. As a convenience, if the first input to an array or struct function looks like JSON, it will be passed directly as a literal instead of a string. . The first example averages an array. The second outputs an array of dependency names in your app by manipulating the JSON object that comes back from the "package list" command. {code:bash} #arrayAvg [1,2,3] package list --JSON | #structFind dependencies | #structKeyArray {code} You must use positional parameters if you are piping data to a CFML function, but you do have the option to use named parameters otherwise. Those names will be passed along directly to the CFML function, so use the CF docs to make sure you're using the correct parameter name. {code:bash} #directoryList path=D:\\ listInfo=name {code}

Class Attributes:
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Method Summary
    private any convertJSONEscapesToCFML(string arg)
    private any escapeArg(string arg)
    any run(string name)
     
    Methods inherited from class lucee.Component
    None

    Method Detail

    convertJSONEscapesToCFML

    private any convertJSONEscapesToCFML(string arg)

    Parameters:
    arg

    escapeArg

    private any escapeArg(string arg)

    Parameters:
    arg

    run

    public any run(string name)

    Parameters:
    name - The name of the CFML function to run