summaryrefslogtreecommitdiff
path: root/lib/prompts.js
blob: e29716d69a9f43c35a4ab02cf88c7466ad9686c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * mongo-edu
 *
 * Copyright (c) 2014-2015 Przemyslaw Pluta
 * Licensed under the MIT license.
 * https://github.com/przemyslawpluta/mongo-edu/blob/master/LICENSE
 */

module.exports = (function build() {

    'use strict';

    return {
        savePreset: [{ 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: [] }],

        confirm: [{ type: 'confirm', name: 'confirm', message: '' }],

        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';
            }}
        ]
    };

}());