commandbox.system.util

Class CommandDSL

lucee.Component
    extended by commandbox.system.util.CommandDSL

Copyright Since 2014 CommandBox by Ortus Solutions, Corp www.coldbox.org | www.ortussolutions.com I am a helper object for executing commands via a DSL. Create me and call my methods to build up a command chain, then .run() will execute me. I am a transient and hold state. Do not share me with your friends.

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • author : Brad Wood, Luis Majano
  •  
    Property Summary
    type property default serializable required
    any append


    • access = public
    • returntype = any
    true false
    any command


    • access = public
    • returntype = any
    true false
    any flags


    • access = public
    • returntype = any
    true false
    any job


    • access = public
    • returntype = any
    • inject = interactiveJob
    true false
    any overwrite


    • access = public
    • returntype = any
    true false
    any params


    • access = public
    • returntype = any
    true false
    any paramsType


    • access = public
    • returntype = any
    true false
    any parser


    • access = public
    • returntype = any
    • inject = parser
    true false
    any piped


    • access = public
    • returntype = any
    true false
    any rawParams


    • access = public
    • returntype = any
    true false
    any shell


    • access = public
    • returntype = any
    • inject = shell
    true false
    any workingDirectory


    • access = public
    • returntype = any
    true false
    Constructor Summary
    init([any name])
          Create a new, executable command.
    Method Summary
    any append(any path)
         Append results to file.
    any flags()
         Add flags to the command.
    string getAppend()
    string getCommand()
    string getCommandString()
         Turn this CFC into a string representation.
    string getFlags()
    string getJob()
    string getOverwrite()
    string getParams()
    string getParamsType()
    string getParser()
    string getPiped()
    string getRawParams()
    string getShell()
    array getTokens()
         Turn this CFC into an array of command tokens.
    string getWorkingDirectory()
    any inWorkingDirectory(any workingDirectory)
         Sets the directory to run the command in.
    any overwrite(any path)
         overwrite file with results.
    any params()
         Add params to the command.
    any pipe([any commandDSL])
         Pipe additional commands.
    private array processParams()
         Convert params to named or positional arguments.
    string run([any returnOutput='false'], [string piped], [boolean echo='false'], [boolean rawParams='false'])
         Run this command.
    any setAppend(any append)
    any setCommand(any command)
    any setFlags(any flags)
    any setJob(any job)
    any setOverwrite(any overwrite)
    any setParams(any params)
    any setParamsType(any paramsType)
    any setParser(any parser)
    any setPiped(any piped)
    any setRawParams(any rawParams)
    any setShell(any shell)
    any setWorkingDirectory(any workingDirectory)
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init([any name])

    Create a new, executable command

    Parameters:
    name - I am the command to execute

    Property Detail

    append

    property any append

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    command

    property any command

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    flags

    property any flags

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    job

    property any job

    Attributes:
    access - public
    required - false
    returntype - any
    inject - interactiveJob
    serializable - true

    overwrite

    property any overwrite

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    params

    property any params

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    paramsType

    property any paramsType

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    parser

    property any parser

    Attributes:
    access - public
    required - false
    returntype - any
    inject - parser
    serializable - true

    piped

    property any piped

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    rawParams

    property any rawParams

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    shell

    property any shell

    Attributes:
    access - public
    required - false
    returntype - any
    inject - shell
    serializable - true

    workingDirectory

    property any workingDirectory

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    Method Detail

    append

    public any append(any path)

    Append results to file

    Parameters:
    path

    flags

    public any flags()

    Add flags to the command


    getAppend

    public string getAppend()


    getCommand

    public string getCommand()


    getCommandString

    public string getCommandString()

    Turn this CFC into a string representation


    getFlags

    public string getFlags()


    getJob

    public string getJob()


    getOverwrite

    public string getOverwrite()


    getParams

    public string getParams()


    getParamsType

    public string getParamsType()


    getParser

    public string getParser()


    getPiped

    public string getPiped()


    getRawParams

    public string getRawParams()


    getShell

    public string getShell()


    getTokens

    public array getTokens()

    Turn this CFC into an array of command tokens


    getWorkingDirectory

    public string getWorkingDirectory()


    inWorkingDirectory

    public any inWorkingDirectory(any workingDirectory)

    Sets the directory to run the command in

    Parameters:
    workingDirectory

    overwrite

    public any overwrite(any path)

    overwrite file with results

    Parameters:
    path

    params

    public any params()

    Add params to the command


    pipe

    public any pipe([any commandDSL])

    Pipe additional commands

    Parameters:
    commandDSL

    processParams

    private array processParams()

    Convert params to named or positional arguments


    run

    public string run([any returnOutput='false'], [string piped], [boolean echo='false'], [boolean rawParams='false'])

    Run this command

    Parameters:
    returnOutput
    piped
    echo
    rawParams

    setAppend

    public any setAppend(any append)

    Parameters:
    append

    setCommand

    public any setCommand(any command)

    Parameters:
    command

    setFlags

    public any setFlags(any flags)

    Parameters:
    flags

    setJob

    public any setJob(any job)

    Parameters:
    job

    setOverwrite

    public any setOverwrite(any overwrite)

    Parameters:
    overwrite

    setParams

    public any setParams(any params)

    Parameters:
    params

    setParamsType

    public any setParamsType(any paramsType)

    Parameters:
    paramsType

    setParser

    public any setParser(any parser)

    Parameters:
    parser

    setPiped

    public any setPiped(any piped)

    Parameters:
    piped

    setRawParams

    public any setRawParams(any rawParams)

    Parameters:
    rawParams

    setShell

    public any setShell(any shell)

    Parameters:
    shell

    setWorkingDirectory

    public any setWorkingDirectory(any workingDirectory)

    Parameters:
    workingDirectory