cli

Contains methods to help initialize and display the CLI

Since: 3.0.0
Example

// Initialize CLI
return lando.cli.init(lando);

cli.startHeader() ⇒ String

Returns a cheeky header that can be used after an app is started.

Kind: static method of cli
Returns: String - A header string we can print to the CLI
Since: 3.0.0
Example

// Print the header to the console
console.log(lando.cli.startHeader());

cli.initHeader() ⇒ String

Returns a cheeky header that can be used after an app is init.

Kind: static method of cli
Returns: String - A header string we can print to the CLI
Since: 3.0.0
Example

// Print the header to the console
console.log(lando.cli.initHeader());

cli.tunnelHeader() ⇒ String

Returns a cheeky header that can be used after an app is shared

Kind: static method of cli
Returns: String - A header string we can print to the CLI
Since: 3.0.0
Example

// Print the header to the console
console.log(lando.cli.tunnelHeader());

cli.Table([opts]) ⇒ Object

Utility function to help construct CLI displayable tables

Kind: static method of cli
Returns: Object - Table metadata that can be printed with toString()
Since: 3.0.0

Param Type Default Description
[opts] Object Options for how the table should be built
[opts.arrayJoiner] String ', ' A delimiter to be used when joining array data

Example

// Grab a new cli table
var table = new lando.cli.Table();

// Add data
table.add('NAME', app.name);
table.add('LOCATION', app.root);
table.add('SERVICES', _.keys(app.services));
table.add('URLS', urls, {arrayJoiner: '\n'});

// Print the table
console.log(table.toString());

cli.init(lando)

Initializes the CLI.

This will either print the CLI usage to the console or route the command and options given by the user to the correct place.

Kind: static method of cli
Emits: event:pre-cli-load
Since: 3.0.0

Param Type Description
lando Object An initialized lando object.

Example

// Initialize the CLI
return lando.cli.init(lando);

"event:pre-cli-load"

Event that allows other things to alter the tasks being loaded to the CLI.

Kind: event emitted by cli
Since: 3.0.0
Properties

Name Type Description
tasks Object An object of Lando tasks

Example

// As a joke remove all tasks and give us a blank CLI
lando.events.on('pre-cli-load', function(tasks) {
  tasks = {};
});

results matching ""

    No results matching ""