File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1+ - [ 2025-04-24] [ Handle undefined args] ( https://github.com/RubricLab/cli/commit/f34a9b004438071586bdd126db88a84ab8f1b9b2 )
12- [ 2025-04-23] [ Support arg typing via command helper] ( https://github.com/RubricLab/cli/commit/01730221c250dc651a1cc466ff3aef85a4361a1e )
23- [ 2025-04-23] [ Trigger build] ( https://github.com/RubricLab/cli/commit/f48dfb50b8388ca5b9a6762aba521093a8226e5b )
34- [ 2025-04-14] [ src -> lib] ( https://github.com/RubricLab/cli/commit/5366d58c027c275252ef7e79f20afd61183949c6 )
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export async function parseCommand({
2020 }
2121
2222 if ( argv [ 0 ] === '--help' || argv [ 0 ] === '-h' ) {
23- showHelp ( { commands, cliName, command : argv [ 1 ] } )
23+ showHelp ( { commands, cliName, command : argv [ 1 ] || '' } )
2424 return
2525 }
2626
@@ -70,11 +70,11 @@ function parseArgs<T extends z.ZodType>({
7070 str . replace ( / - ( [ a - z ] ) / g, ( _ , letter ) => letter . toUpperCase ( ) )
7171
7272 for ( let i = 0 ; i < argv . length ; i ++ ) {
73- const arg = argv [ i ]
73+ const arg = argv [ i ] || ''
7474
7575 const flagMatch = arg . match ( flagRegex )
7676 if ( flagMatch ) {
77- const flagName = kebabToCamel ( flagMatch [ 1 ] )
77+ const flagName = kebabToCamel ( flagMatch [ 1 ] || '' )
7878
7979 const nextArg = argv [ i + 1 ]
8080 const nextIsValue = nextArg && ! nextArg . startsWith ( '-' )
@@ -105,7 +105,7 @@ function parseArgs<T extends z.ZodType>({
105105
106106 const shortMatch = arg . match ( shortFlagRegex )
107107 if ( shortMatch ) {
108- const flags = shortMatch [ 1 ] . split ( '' )
108+ const flags = ( shortMatch [ 1 ] || '' ) . split ( '' )
109109 for ( const flag of flags ) {
110110 if ( schema instanceof z . ZodObject ) {
111111 const shape = schema . shape
Original file line number Diff line number Diff line change 88 "lint:fix" : " bun x biome lint . --write --unsafe"
99 },
1010 "name" : " @rubriclab/cli" ,
11- "version" : " 0.0.6 " ,
11+ "version" : " 0.0.7 " ,
1212 "main" : " lib/index.ts" ,
1313 "private" : false ,
1414 "dependencies" : {
You can’t perform that action at this time.
0 commit comments