Skip to content

Commit ea272e7

Browse files
committed
Add update help
1 parent 53a3116 commit ea272e7

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

src/commands/dev/help.js

+3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ module.exports = {
88
{
99
name: '-p, --port',
1010
description: `Configure the dev server's HTTP port`,
11+
optional: true,
1112
},
1213
{
1314
name: '-v, --verbose',
1415
description: 'Enable verbose output',
16+
optional: true,
1517
},
1618
{
1719
name: '--disable-symlinks',
1820
description: '[Advanced] Disable shared code symlinking',
21+
optional: true,
1922
},
2023
],
2124
},

src/commands/update/help.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
en: {
3+
usage: [ 'update', '[options]' ],
4+
description: 'Update Begin to the latest version',
5+
contents: {
6+
header: 'Update options',
7+
items: [
8+
{
9+
name: '--use',
10+
description: 'Switch between `latest` (stable) and `main` (canary) channels',
11+
optional: true,
12+
},
13+
],
14+
}
15+
}
16+
}

src/commands/update/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
let names = { en: [ 'update', 'upgrade' ] }
2+
let help = require('./help')
23

34
async function action (params) {
45
let { appVersion, args } = params
@@ -117,4 +118,5 @@ async function getVersions () {
117118
module.exports = {
118119
names,
119120
action,
121+
help,
120122
}

src/helper/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = function helper (params, cmdHelp) {
4040
help += br(2) + `${c.dim('Global options:')}\n${globalOptions}`
4141

4242
// Examples
43-
if (examples.length) {
43+
if (examples?.length) {
4444
let exampleItems = examples.map(({ name, example }) => {
4545
return `${indent}${name}\n${indent}${c.green('$ ' + example)}`
4646
}).join(br(2))

0 commit comments

Comments
 (0)