@@ -39,7 +39,8 @@ program
39
39
. option ( '--standard-json' , 'Turn on Standard JSON Input / Output mode.' )
40
40
. option ( '--base-path <path>' , 'Automatically resolve all imports inside the given path.' )
41
41
. option ( '-o, --output-dir <output-directory>' , 'Output directory for the contracts.' )
42
- . option ( '-p, --pretty-json' , 'Pretty-print all JSON output.' , false ) ;
42
+ . option ( '-p, --pretty-json' , 'Pretty-print all JSON output.' , false )
43
+ . option ( '-v, --verbose' , 'More detailed console output.' , false ) ;
43
44
44
45
program . parse ( process . argv ) ;
45
46
const options = program . opts ( ) ;
@@ -106,11 +107,15 @@ if (options.basePath || !options.standardJson)
106
107
107
108
if ( options . standardJson ) {
108
109
var input = fs . readFileSync ( process . stdin . fd ) . toString ( 'utf8' ) ;
110
+ if ( program . verbose )
111
+ console . log ( '>>> Compiling:\n' + reformatJsonIfRequested ( input ) + "\n" )
109
112
var output = reformatJsonIfRequested ( solc . compile ( input , callbacks ) ) ;
110
113
111
114
try {
112
115
var inputJSON = smtchecker . handleSMTQueries ( JSON . parse ( input ) , JSON . parse ( output ) , smtsolver . smtSolver ) ;
113
116
if ( inputJSON ) {
117
+ if ( program . verbose )
118
+ console . log ( '>>> Retrying compilation with SMT:\n' + toFormattedJson ( inputJSON ) + "\n" )
114
119
output = reformatJsonIfRequested ( solc . compile ( JSON . stringify ( inputJSON ) , callbacks ) ) ;
115
120
}
116
121
}
@@ -130,6 +135,8 @@ if (options.standardJson) {
130
135
output = toFormattedJson ( outputJSON ) ;
131
136
}
132
137
138
+ if ( program . verbose )
139
+ console . log ( '>>> Compilation result:' )
133
140
console . log ( output ) ;
134
141
process . exit ( 0 ) ;
135
142
} else if ( files . length === 0 ) {
@@ -151,7 +158,7 @@ for (var i = 0; i < files.length; i++) {
151
158
}
152
159
}
153
160
154
- var output = JSON . parse ( solc . compile ( JSON . stringify ( {
161
+ const cliInput = {
155
162
language : 'Solidity' ,
156
163
settings : {
157
164
optimizer : {
@@ -165,7 +172,10 @@ var output = JSON.parse(solc.compile(JSON.stringify({
165
172
}
166
173
} ,
167
174
sources : sources
168
- } ) , callbacks ) ) ;
175
+ } ;
176
+ if ( program . verbose )
177
+ console . log ( '>>> Compiling:\n' + toFormattedJson ( cliInput ) + "\n" )
178
+ var output = JSON . parse ( solc . compile ( JSON . stringify ( cliInput ) , callbacks ) ) ;
169
179
170
180
let hasError = false ;
171
181
0 commit comments