From 75245d62fdd7230ac3bdb634f26ad0da8826f61f Mon Sep 17 00:00:00 2001 From: przemyslawpluta Date: Sun, 28 Sep 2014 18:36:08 +0100 Subject: cleanup --- lib/prompts.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 lib/prompts.js (limited to 'lib/prompts.js') diff --git a/lib/prompts.js b/lib/prompts.js new file mode 100644 index 0000000..0af81e8 --- /dev/null +++ b/lib/prompts.js @@ -0,0 +1,44 @@ +/* + * mongo-edu + * + * Copyright (c) 2014 Przemyslaw Pluta + * Licensed under the MIT license. + * https://github.com/przemyslawpluta/mongo-edu/blob/master/LICENSE + */ + +module.exports = (function build() { + + 'use strict'; + + return { + savePrompt: [{ type: 'input', name: 'save', message: 'Missing [ --save ] Preset Name', default: '', validate: function(value) { + if (value !== '') { return true; } + return 'Please enter [ --save ] preset name'; + }}], + + loadPreset: function loadPreset(data) { + return [{ type: 'list', name: 'preset', message: 'Select Preset To Load:', choices: data}]; + }, + + list: [{ type: 'list', name: 'url', message: '', choices: [] }], + + check: [{ type: 'checkbox', message: '', name: 'videos', choices: [], + validate: function validate(answer) { + if ( answer.length < 1 ) { return 'You must choose at least one option.'; } + return true; + } + }], + + profile: [ + { type: 'input', name: 'user', message: 'MongoDB Uni User Name', default: '', validate: function(value) { + if (value !== '') { return true; } + return 'Please enter your MongoDB Uni user name - email address'; + }}, + { type: 'password', message: 'MongoDB Uni Password', name: 'password', validate: function(value) { + if (value !== '') { return true; } + return 'Please enter your MongoDB Uni password'; + }} + ] + }; + +}()); -- cgit v1.2.3