UNPKG

908 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3function addCfgKey(argv) {
4 return argv.positional('key', {
5 describe: 'Config key',
6 type: 'string'
7 });
8}
9exports.addCfgKey = addCfgKey;
10function addPwd(argv) {
11 return argv.option('password', {
12 alias: 'pwd',
13 describe: 'Encryption password',
14 type: 'string'
15 });
16}
17exports.addPwd = addPwd;
18function addEncrypt(argv, alias = 'enc') {
19 const opt = {
20 default: false,
21 describe: 'Encrypt the input',
22 type: 'boolean'
23 };
24 if (alias) {
25 opt.alias = alias;
26 }
27 return argv.option('encrypt', opt);
28}
29exports.addEncrypt = addEncrypt;
30function addCfgScope(argv) {
31 return argv.positional('scope', {
32 describe: 'Optional scope of the config key (defaults to global)',
33 type: 'string'
34 });
35}
36exports.addCfgScope = addCfgScope;