-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfixtures.js
118 lines (116 loc) · 2.68 KB
/
fixtures.js
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import {help} from './helper'
import pkg from '../package.json'
export const tree = {
options: [
{
long: 'verbose',
description: 'show all logs',
type: 'boolean',
},
{
short: 'h',
long: 'help',
description: 'show help information',
type: 'boolean',
},
{
long: 'version',
short: 'v',
description: 'show version number',
type: 'boolean',
},
],
handler: (options) => {
if (options.h || options.help) {
console.log(help(tree, {name: 'findhelp'}))
} else if (options.v || options.version) {
console.log(pkg.version)
} else {
console.log('Hi, there! :)')
}
},
login: {
requiredArgs: 'store',
optionalArgs: 'email',
description: 'Login with your account',
handler: console.log.bind(console),
},
logout: {
description: 'Logout from current account',
handler: console.log.bind(console),
},
list: {
alias: 'ls',
description: 'List your packages',
optionalArgs: 'query',
options: [
{
short: 'a',
long: 'all',
description: 'show hidden',
type: 'boolean',
},
],
handler: console.log.bind(console),
},
install: {
requiredArgs: 'app',
alias: 'i',
description: 'Install the given app',
handler: console.log.bind(console),
},
uninstall: {
requiredArgs: 'app',
description: 'Remove the given app',
handler: console.log.bind(console),
},
publish: {
requiredArgs: 'app',
description: 'Publish this app',
handler: console.log.bind(console),
},
workspace: {
new: {
requiredArgs: 'name',
description: 'Create a new workspace',
handler: console.log.bind(console),
},
delete: {
requiredArgs: 'name',
description: 'Delete this workspace',
options: [
{
short: 'a',
long: 'account',
type: 'string',
},
],
handler: console.log.bind(console),
},
promote: {
description: 'Promote this workspace to master',
requiredArgs: 'name',
handler: console.log.bind(console),
},
list: {
description: 'List available workspaces',
handler: console.log.bind(console),
},
},
settings: {
requiredArgs: 'app',
optionalArgs: 'field',
description: 'Get an app\'s settings',
handler: console.log.bind(console),
set: {
requiredArgs: ['app', 'field', 'value'],
description: 'Set an app\'s settings value',
handler: console.log.bind(console),
},
unset: {
requiredArgs: ['app', 'field'],
description: 'Unset an app\'s settings value',
handler: console.log.bind(console),
},
},
}