@@ -111,22 +111,18 @@ export function popArgument(args: string[], arg: string) {
111111
112112export function partitionArguments (
113113 args : string [ ] ,
114- delimiter : string
114+ delimiter : string ,
115+ defaultArgs ?: string [ ]
115116) : [ string [ ] , string [ ] ] {
116117 const index = args . indexOf ( delimiter ) ;
117- return index >= 0
118- ? [ args . slice ( 0 , index ) , args . slice ( index + 1 ) ]
119- : [ args , [ ] ] ;
120- }
118+ const [ providedCargoArgs , providedCommandArgs ] =
119+ index >= 0 ? [ args . slice ( 0 , index ) , args . slice ( index + 1 ) ] : [ args , [ ] ] ;
121120
122- export function partitionArgumentsWithDefaultArgs (
123- args : string [ ] ,
124- delimiter : string ,
125- defaultArgs ?: string [ ] ,
126- ) : [ string [ ] , string [ ] ] {
127- const [ providedCargoArgs , providedCommandArgs ] = partitionArguments ( args , delimiter ) ;
128121 if ( defaultArgs ) {
129- const [ defaultCargoArgs , defaultCommandArgs ] = partitionArguments ( defaultArgs , delimiter ) ;
122+ const [ defaultCargoArgs , defaultCommandArgs ] = partitionArguments (
123+ defaultArgs ,
124+ delimiter
125+ ) ;
130126 return [
131127 [ ...defaultCargoArgs , ...providedCargoArgs ] ,
132128 [ ...defaultCommandArgs , ...providedCommandArgs ] ,
@@ -144,10 +140,14 @@ export async function getInstalledSolanaVersion(): Promise<string | undefined> {
144140 }
145141}
146142
147- export function parseCliArguments ( ) : { command : string , libraryPath : string ; args : string [ ] } {
143+ export function parseCliArguments ( ) : {
144+ command : string ;
145+ libraryPath : string ;
146+ args : string [ ] ;
147+ } {
148148 const command = process . argv [ 2 ] ;
149149 const args = process . argv . slice ( 3 ) ;
150-
150+
151151 // Extract the relative crate directory from the command-line arguments. This
152152 // is the only required argument.
153153 const relativePath = args . shift ( ) ;
0 commit comments