The CLI Unit

flitter-cli/CliUnit

exports:  class CliUnit

class CliUnit

extends:  libflitter/Unit

Processes the specified CLI arguments and executes them.

go(express app, function next)

overrides:  super.go()         returns:  undefined

Calls the next function in the stack. This is here for future use.

serve(Object units)

returns:  undefined

Launches Flitter with an instance of libflitter/app/FlitterApp as the final Unit. This is effectively a "normal" Flitter server. It launches Flitter using the Unit name-Unit instance key-value pairs passed in the units Object.

interactive(Object units)

returns:  undefined

Launches Flitter with an instance of flitter-cli/InteractiveUnit as the final Unit. Rather than starting the normal Flitter HTTP server, this launches an interactive shell. It launches Flitter using the Unit name-Unit instance key-value pairs passed in the units Object.

directive(Object units)

returns:  undefined

Launches Flitter with an instance of flitter-cli/DirectiveUnit as the final Unit. Rather than starting the normal Flitter HTTP server, this executes an arbitrary function from within all Flitter contexts. It launches Flitter using the Unit name-Unit instance key-value pairs passed in the units Object.

interpreter(Object units)

returns:  undefined

Parses CLI directives and handles them appropriately.

provides()

returns:  Object

Returns an Object describing the services, templates, and directories provided by this unit. They are as follows:

Type Key Value Notes
Service Name name "flitter-cli" The name of the service. This is added to the _flit.services array so other units can check for this unit.

 

No Comments
Back to top