Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 87c97d9

Browse files
author
Wenjie Xia
committed
refactor(cli): update help messages
1 parent 42a4f45 commit 87c97d9

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

cli.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const commands = {
1616
}
1717

1818
const helpMessage = `Aleph.js v${VERSION}
19-
The React Framework in deno.
19+
The Full-stack Framework in Deno.
2020
2121
Docs: https://alephjs.org/docs
2222
Bugs: https://github.com/alephjs/aleph.js/issues
@@ -28,8 +28,8 @@ Commands:
2828
${Object.entries(commands).map(([name, desc]) => `${name.padEnd(15)}${desc}`).join('\n ')}
2929
3030
Options:
31-
-h, --help Prints help message
3231
-v, --version Prints version number
32+
-h, --help Prints help message
3333
`
3434

3535
async function main() {
@@ -162,14 +162,14 @@ async function main() {
162162

163163
const { default: cmd } = await import(`./cli/${command}.ts`)
164164
if (command === 'upgrade') {
165-
await cmd(argOptions.v || argOptions.version || 'latest')
166-
} else {
167-
const appDir = path.resolve(args[0] || '.')
168-
if (command !== 'init' && !existsDirSync(appDir)) {
169-
log.fatal('No such directory:', appDir)
170-
}
171-
await cmd(appDir, argOptions)
165+
await cmd(argOptions.v || argOptions.version || args[0] || 'latest')
166+
return
167+
}
168+
const appDir = path.resolve(args[0] || '.')
169+
if (command !== 'init' && !existsDirSync(appDir)) {
170+
log.fatal('No such directory:', appDir)
172171
}
172+
await cmd(appDir, argOptions)
173173
}
174174

175175
if (import.meta.main) {

cli/build.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Usage:
88
if the <dir> is empty, the current directory will be used.
99
1010
Options:
11-
-L, --log-level Set log level [possible values: debug, info]
12-
-r, --reload Reload source code cache
13-
-h, --help Prints help message
11+
-L, --log-level <log-level> Set log level [possible values: debug, info]
12+
-r, --reload Reload source code cache
13+
-h, --help Prints help message
1414
`
1515

1616
export default async function (appDir: string, options: Record<string, string | boolean>) {

cli/dev.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Usage:
99
if the <dir> is empty, the current directory will be used.
1010
1111
Options:
12-
-p, --port A port number to start the Aleph.js app, default is 8080
13-
-L, --log-level Set log level [possible values: debug, info]
14-
-r, --reload Reload source code cache
15-
-h, --help Prints help message
12+
-p, --port <port> A port number to start the Aleph.js app, default is 8080
13+
-L, --log-level <log-level> Set log level [possible values: debug, info]
14+
-r, --reload Reload source code cache
15+
-h, --help Prints help message
1616
`
1717

1818
export default async function (appDir: string, options: Record<string, string | boolean>) {

cli/start.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ Usage:
88
if the <dir> is empty, the current directory will be used.
99
1010
Options:
11-
-hn, --hostname The address at which the server is to be started.
12-
-p, --port A port number to start the aleph.js app, default is 8080
13-
-L, --log-level Set log level [possible values: debug, info]
14-
-r, --reload Reload source code cache
15-
-h, --help Prints help message
11+
-hn, --hostname <hostname> The address at which the server is to be started
12+
-p, --port <port> A port number to start the aleph.js app, default is 8080
13+
-L, --log-level <log-level> Set log level [possible values: debug, info]
14+
-r, --reload Reload source code cache
15+
-h, --help Prints help message
1616
`
1717

1818
export default async function (appDir: string, options: Record<string, string | boolean>) {

cli/upgrade.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { colors } from '../deps.ts'
2-
import { VERSION as currentVersion } from '../version.ts'
2+
import { VERSION } from '../version.ts'
33

44
export const helpMessage = `
55
Usage:
66
aleph upgrade
77
88
Options:
9-
-v, --version <version> The version to upgrade to
9+
-v, --version <version> The upgrading version
1010
-h, --help Prints help message
1111
`
1212

@@ -32,7 +32,7 @@ export default async function (version: string) {
3232
Deno.exit(1)
3333
}
3434
}
35-
if (version === 'v' + currentVersion) {
35+
if (version === 'v' + VERSION) {
3636
console.log('Already up-to-date!')
3737
Deno.exit(0)
3838
}

0 commit comments

Comments
 (0)