Skip to content

Commit bc9c34a

Browse files
committed
chore: wip
1 parent f9e6709 commit bc9c34a

File tree

6 files changed

+10
-16
lines changed

6 files changed

+10
-16
lines changed

.stacks/core/actions/src/deploy/domains.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { parseArgs } from '@stacksjs/cli'
22

3-
const options = parseArgs()
3+
const options = parseArgs(process.argv.slice(2))
44

55
console.log('options', options)
66

.stacks/core/cli/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
"ora": "^6.3.0"
6060
},
6161
"dependencies": {
62-
"kolorist": "1.8.0"
62+
"kolorist": "1.8.0",
63+
"mri": "^1.2.0"
6364
},
6465
"devDependencies": {
6566
"@stacksjs/development": "workspace:*",

.stacks/core/cli/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export * from './actions'
22
export * from './command'
33
export * from './console'
44
export * from './helpers'
5+
export * from './parse'
56
export * from './run'
67
export * from './spinner'
78
export * from './utilities'

.stacks/core/cli/src/parse.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import mri from 'mri'
2+
3+
export const parseArgs = (argv: string[]) => mri(argv)

.stacks/core/cli/src/utilities.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1 @@
1-
export function parseArgs(args?: string[]) {
2-
if (!args)
3-
args = process.argv.slice(2)
4-
5-
// parse the args into an object
6-
return args.reduce((acc, arg) => {
7-
if (arg.startsWith('--')) {
8-
const [key, value] = arg.slice(2).split('=')
9-
acc[key] = value !== 'false'
10-
}
11-
return acc
12-
}, {} as Record<string, boolean>)
13-
}
14-
151
export { ansi256Bg, bgBlack, bgBlue, bgCyan, bgGray, bgGreen, bgLightBlue, bgLightCyan, bgLightGray, bgLightGreen, bgLightMagenta, bgLightRed, bgLightYellow, bgMagenta, bgRed, bgWhite, bgYellow, black, blue, bold, cyan, dim, gray, green, hidden, inverse, italic, lightBlue, lightCyan, lightGray, lightGreen, lightMagenta, lightRed, lightYellow, link, magenta, red, reset, strikethrough, underline, white, yellow } from 'kolorist'

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)