scripts/generator.js
function showCommandsOnCmdEditor (config) {

	console.log(colors.bold('\nAvailable Commands for ' + config.deviceName + ':\n'));

	// Iterate the each commands
	var commands = config.commands || {};
	if (Object.keys(commands).length == 0) {
		console.log ('\nThere is no command.');
	} else {
		for (var name in commands) {
			var desc = commands[name].description || '';
			console.log(colors.bold('\n' + name + '') + '\n  ' + desc + '\n');

			// Iterate the each arguments
			var args = commands[name].args || {};
			if (Object.keys(args).length == 0) {
				console.log ('\tThe arguments of this command are not defined');
			} else {
				for (var arg_name in args) {
					var arg_spec = args[arg_name] || '';
					console.log('\t* ' + arg_name + ' - ' + arg_spec);
				}
			}

		}
	}

	console.log('\n');

	// Done
	return new Promise(function (resolve, reject) {
		resolve();
	});

}
function showCommandsOnCmdEditor (config) {

	console.log(colors.bold('\nAvailable Commands for ' + config.deviceName + ':\n'));

	// Iterate the each commands
	var commands = config.commands || {};
	if (Object.keys(commands).length == 0) {
		console.log ('\nThere is no command.');
	} else {
		for (var name in commands) {
			var desc = commands[name].description || '';
			console.log(colors.bold('\n' + name + '') + '\n  ' + desc + '\n');

			// Iterate the each arguments
			var args = commands[name].args || {};
			if (Object.keys(args).length == 0) {
				console.log ('\tThe arguments of this command are not defined');
			} else {
				for (var arg_name in args) {
					var arg_spec = args[arg_name] || '';
					console.log('\t* ' + arg_name + ' - ' + arg_spec);
				}
			}

		}
	}

	console.log('\n');

	// Done
	return new Promise(function (resolve, reject) {
		resolve();
	});

}
function showCommandsOnCmdEditor ( config ) { console . log ( colors . bold ( '\nAvailable Commands for ' + config . deviceName + ':\n' ) ) ; // Iterate the each commands var commands = config . commands || { } ; if ( Object . keys ( commands ) . length == 0 ) { console . log ( '\nThere is no command.' ) ; } else { for ( var name in commands ) { var desc = commands [ name ] . description || '' ; console . log ( colors . bold ( '\n' + name + '' ) + '\n  ' + desc + '\n' ) ; // Iterate the each arguments var args = commands [ name ] . args || { } ; if ( Object . keys ( args ) . length == 0 ) { console . log ( '\tThe arguments of this command are not defined' ) ; } else { for ( var arg_name in args ) { var arg_spec = args [ arg_name ] || '' ; console . log ( '\t* ' + arg_name + ' - ' + arg_spec ) ; } } } } console . log ( '\n' ) ; // Done return new Promise ( function ( resolve , reject ) { resolve ( ) ; } ) ; }
Command Editor - Show a list of the commands
@param  {Object} config             Current configuration
@return {Promise}
Command Editor - Show a list of the commands