File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,11 @@ async function printTopAccountBalances(count: number, blockHeight: number) {
114
114
await db . close ( ) ;
115
115
}
116
116
117
+ function printUsage ( ) {
118
+ console . log ( `Usage:` ) ;
119
+ console . log ( ` node ./index.js stx-balances [--count=<count>] [--block-height=<height>]` ) ;
120
+ }
121
+
117
122
async function handleProgramArgs ( ) {
118
123
const parsedOpts = getopts ( process . argv . slice ( 2 ) ) ;
119
124
const args = {
@@ -130,10 +135,10 @@ async function handleProgramArgs() {
130
135
if ( args . operand === 'stx-balances' ) {
131
136
await printTopAccountBalances ( args . options . count ?? 10 , args . options [ 'block-height' ] ?? 0 ) ;
132
137
} else if ( parsedOpts . _ [ 0 ] ) {
138
+ printUsage ( ) ;
133
139
throw new Error ( `Unexpected program argument: ${ parsedOpts . _ [ 0 ] } ` ) ;
134
140
} else {
135
- // TODO: Display usage.
136
- throw new Error ( `Program arguments required` ) ;
141
+ printUsage ( ) ;
137
142
}
138
143
}
139
144
You can’t perform that action at this time.
0 commit comments