Extends
Members
(static) name
Gets the name of the service provided by this unit: 'cli'
- Source:
(static) services
Defines the services required by this unit.
- Source:
(private) _di_allow_defer :boolean
If true, the injector will defer the class if the class requests any services that the container is missing. These services are filled in later and added to the prototype and any instances. True by default.
- boolean
- Inherited From:
- Source:
(private) _di_deferred_instances :Array.<module:flitter-di/src/Injectable~Injectable>
Collection of instances of this class that need to have the deferred service instances injected into them when the deferred services are finally provided.
- Source:
(private) _di_deferred_services :Array.<string>
List of services that were deferred and not provided at the time of injection.
- Array.<string>
- Source:
Methods
(async) cleanup(app) → {Promise.<void>}
Cleans up the unit's resources before Flitter closes.
Name | Type | Description |
---|---|---|
app |
module:libflitter/app/FlitterApp~FlitterApp | the Flitter app |
- Inherited From:
- Source:
- Type
- Promise.<void>
directives() → {Object}
Get the directive classes provided by this unit. Should be key-value pairs such that the key is the name of the class, and the value is an instance of module:flitter-cli/Directive~Directive.
- Source:
- Type
- Object
directories() → {Object}
Get the directories provided by the unit. Should be an object such that key => value is the name of the directory => fully qualified path to the directory.
- Inherited From:
- Source:
- Type
- Object
(async) go(app, context) → {Promise.<void>}
Loads the module. If any registered unit has deployments/templates/directives, register them with flitter-cli. Register the help messages to be used by ./flitter help. Then, bind them all to the context.
Name | Type | Description |
---|---|---|
app |
module:libflitter/app/FlitterApp~FlitterApp | the Flitter app |
context |
module:libflitter/Context~Context | the Unit's context |
- Overrides:
- Source:
- Type
- Promise.<void>
(async) invoke(directive, argv) → {Promise.<Array>}
Invoke a command, programmatically. Replaces console.log with a pseudo function that collects messages.
Name | Type | Description |
---|---|---|
directive |
string | the directive to be called |
argv |
Array.<string> | array of command line arguments |
- Source:
- array of items that were sent to console.log during the command's execution
- Type
- Promise.<Array>
name() → {string}
Get the name of the unit.
- Overrides:
- Source:
"cli"
- Type
- string
status(setopt) → {string}
Get or set the unit's current status.
Name | Type | Attributes | Description |
---|---|---|---|
set |
string |
<optional> |
if provided, set the status of the unit |
- Inherited From:
- Source:
- current status of the unit
- Type
- string