Skip to content

Commit

Permalink
feat: help format
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Feb 3, 2023
1 parent 42d2cd7 commit b1da3c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const vite = breadc('vite', {
default: '/'
})
.option('-l, --logLevel <level>', `[string] info | warn | error | silent`)
.option('--clearScreen', `[boolean] allow/disable clear screen when logging`)
.option('--clear-screen', `[boolean] allow/disable clear screen when logging`)
.option('-d, --debug <feat>', `[string | boolean] show debug logs`)
.option('-f, --filter <filter>', `[string] filter debug logs`)
.option('-m, --mode <mode>', `[string] set env mode`);
Expand All @@ -21,7 +21,7 @@ vite
.option('--https', `<boolean> use TLS + HTTP/2`)
.option('--open <path>', `[boolean | string] open browser on startup`)
.option('--cors', `[boolean] enable CORS`)
.option('--strictPort', `[boolean] exit if specified port is already in use`)
.option('--strict-port', `[boolean] exit if specified port is already in use`)
.option(
'--force',
`[boolean] force the optimizer to ignore the cache and re-bundle`
Expand Down
8 changes: 4 additions & 4 deletions packages/breadc/src/command.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bold } from '@breadc/color';
import { bold, underline } from '@breadc/color';

import type {
AppOption,
Expand Down Expand Up @@ -283,9 +283,9 @@ export function makeHelpCommand(name: string, config: AppOption): Option {
if (cmds.length > 0) {
return [
'',
'Commands:',
underline('Commands:'),
cmds.map((cmd) => [
` ${name} ${bold(cmd.format)}`,
` ${bold(name)} ${bold(cmd.format)}`,
cmd.description
])
];
Expand All @@ -294,7 +294,7 @@ export function makeHelpCommand(name: string, config: AppOption): Option {
}
},
'',
'Options:',
underline('Options:'),
[...context.options.entries()]
.filter(([key, op]) => key === op.name)
.sort((lhs, rhs) => lhs[1].order - rhs[1].order)
Expand Down

0 comments on commit b1da3c2

Please sign in to comment.