@@ -20,8 +20,9 @@ export function parseArgs(rawArgs: string[]): WhookRawCommandArgs {
2020 ( cleanArgs , key ) => ( {
2121 ...cleanArgs ,
2222 // Avoid having the --arg shortcut for --arg=true to
23- // provide a boolean since we coerce the args later
24- [ key ] : typeof args [ key ] === 'boolean' ? args [ key ] . toString ( ) : args [ key ] ,
23+ // provide a boolean since we coerce the args later
24+ [ key ] :
25+ typeof args [ key ] === 'boolean' ? args [ key ] . toString ( ) : args [ key ] ,
2526 } ) ,
2627 { } ,
2728 ) ,
@@ -53,16 +54,7 @@ export async function promptArgs(
5354 API ,
5455 schema . $ref ,
5556 ) ) as WhookCommandSchema ;
56- newNamedArgs [ argument . name ] = await input ( {
57- message : `Enter the value for "${ argument . name } ": ` ,
58- default : schema . default ?. toString ( ) ,
59- required : argument . required ,
60- } ) ;
61- continue ;
62- }
6357
64- if ( ! ( 'default' in schema ) ) {
65- newNamedArgs [ argument . name ] = schema . default ?. toString ( ) ;
6658 continue ;
6759 }
6860
@@ -107,7 +99,15 @@ export async function promptArgs(
10799 newNamedArgs [ argument . name ] = await input ( {
108100 message : `Enter the value for "${ argument . name } ": ` ,
109101 required : argument . required ,
102+ default : schema . default ?. toString ( ) ,
110103 } ) ;
104+
105+ continue ;
106+ }
107+
108+ if ( 'default' in schema ) {
109+ newNamedArgs [ argument . name ] = schema . default ;
110+ continue ;
111111 }
112112 }
113113 }
0 commit comments