Commit b396232 1 parent 9636be4 commit b396232 Copy full SHA for b396232
File tree 1 file changed +13
-3
lines changed
v-next/hardhat/src/internal/cli/helpers
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,12 @@ export function getSection(
99
99
items : ArgumentDescriptor [ ] ,
100
100
namePadding : number ,
101
101
) : string {
102
- return `\n${ title } :\n\n${ items . map ( ( { name, description } ) => ` ${ name . padEnd ( namePadding ) } ${ description } ` ) . join ( "\n" ) } \n` ;
102
+ return `\n${ title } :\n\n${ items
103
+ . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
104
+ . map (
105
+ ( { name, description } ) => ` ${ name . padEnd ( namePadding ) } ${ description } ` ,
106
+ )
107
+ . join ( "\n" ) } \n`;
103
108
}
104
109
105
110
export function getUsageString (
@@ -110,11 +115,16 @@ export function getUsageString(
110
115
let output = `Usage: hardhat [GLOBAL OPTIONS] ${ task . id . join ( " " ) } ` ;
111
116
112
117
if ( options . length > 0 ) {
113
- output += ` ${ options . map ( ( o ) => `[${ o . name } ${ o . type === "BOOLEAN" ? "" : ` <${ o . type } >` } ]` ) . join ( " " ) } ` ;
118
+ output += ` ${ options
119
+ . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
120
+ . map ( ( o ) => `[${ o . name } ${ o . type === "BOOLEAN" ? "" : ` <${ o . type } >` } ]` )
121
+ . join ( " " ) } `;
114
122
}
115
123
116
124
if ( positionalArguments . length > 0 ) {
117
- output += ` [--] ${ positionalArguments . map ( ( a ) => ( a . isRequired === true ? a . name : `[${ a . name } ]` ) ) . join ( " " ) } ` ;
125
+ output += ` [--] ${ positionalArguments
126
+ . map ( ( a ) => ( a . isRequired === true ? a . name : `[${ a . name } ]` ) )
127
+ . join ( " " ) } `;
118
128
}
119
129
120
130
return output ;
You can’t perform that action at this time.
0 commit comments